42 #include <px4_platform_common/defines.h> 46 #include <sys/ioctl.h> 50 #include <nshlib/nshlib.h> 54 #include <asm/socket.h> 61 PX4_INFO(
"Stopping mavlink shell");
78 PX4_INFO(
"Starting mavlink shell");
110 for (
int i = 0; i < 2; ++i) {
111 fd_backups[i] = dup(i);
113 if (fd_backups[i] == -1) {
122 _task = px4_task_spawn_cmd(
"mavlink_shell",
124 SCHED_PRIORITY_DEFAULT,
135 for (
int i = 0; i < 2; ++i) {
136 if (dup2(fd_backups[i], i) == -1) {
140 close(fd_backups[i]);
155 nsh_consolemain(0, NULL);
int _from_shell_fd
fd to write to the shell
static int shell_start_thread(int argc, char *argv[])
int _shell_fds[2]
fd to read from the shell
static void read(bootloader_app_shared_t *pshared)
px4_task_t _task
stdin & out used by the shell
int start()
Start the mavlink shell.
static void write(bootloader_app_shared_t *pshared)
A shell to be used via MAVLink.
size_t read(uint8_t *buffer, size_t len)
Read from the shell.
size_t write(uint8_t *buffer, size_t len)
Write to the shell.
size_t available()
Get the number of bytes that can be read.