39 #include <px4_platform_common/px4_config.h> 40 #include <px4_platform_common/module.h> 48 #include <nshlib/nshlib.h> 60 PRINT_MODULE_DESCRIPTION(
"Start an NSH shell on a given port.\n" 62 "This was previously used to start a shell on the USB serial port.\n" 63 "Now there runs mavlink, and it is possible to use a shell over mavlink.\n" 66 PRINT_MODULE_USAGE_NAME_SIMPLE(
"nshterm",
"command");
67 PRINT_MODULE_USAGE_ARG(
"<file:dev>",
"Device on which to start the shell (eg. /dev/ttyACM0)",
false);
110 fd = open(argv[1], O_RDWR);
129 struct termios uart_config;
133 if ((termios_state = tcgetattr(fd, &uart_config)) < 0) {
134 warnx(
"ERR get config %s: %d\n", argv[1], termios_state);
140 uart_config.c_oflag |= (ONLCR | OPOST);
142 if ((termios_state = tcsetattr(fd, TCSANOW, &uart_config)) < 0) {
143 warnx(
"ERR set config %s\n", argv[1]);
156 nsh_consolemain(0, NULL);
int orb_copy(const struct orb_metadata *meta, int handle, void *buffer)
High-resolution timer with callouts and timekeeping.
int orb_subscribe(const struct orb_metadata *meta)
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
static void print_usage(void)
__EXPORT int nshterm_main(int argc, char *argv[])
int orb_check(int handle, bool *updated)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).