PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <poll.h>
#include <fcntl.h>
#include <unistd.h>
#include <px4_platform_common/tasks.h>
#include <px4_platform_common/module.h>
#include <px4_platform_common/getopt.h>
#include <systemlib/err.h>
#include <termios.h>
#include <drivers/drv_hrt.h>
#include <uORB/topics/vehicle_air_data.h>
#include <math.h>
#include "sPort_data.h"
#include "frsky_data.h"
#include "common.h"
Go to the source code of this file.
Enumerations | |
enum | frsky_state_t { SCANNING, SPORT, SPORT_SINGLE_WIRE, DTYPE } |
Functions | |
static int | sPort_open_uart (const char *uart_name, struct termios *uart_config, struct termios *uart_config_original) |
Opens the UART device and sets all required serial parameters. More... | |
static int | set_uart_speed (int uart, struct termios *uart_config, speed_t speed) |
static void | usage () |
Print command usage information. More... | |
static int | frsky_telemetry_thread_main (int argc, char *argv[]) |
The daemon thread. More... | |
__EXPORT int | frsky_telemetry_main (int argc, char *argv[]) |
The main command function. More... | |
uint16_t | get_telemetry_flight_mode (int px4_flight_mode) |
Map the PX4 flight mode (vehicle_status_s::nav_state) to the telemetry flight mode. More... | |
static void | set_uart_single_wire (int uart, bool single_wire) |
Variables | |
static volatile bool | thread_should_exit = false |
static volatile bool | thread_running = false |
static int | frsky_task |
static frsky_state_t | frsky_state = SCANNING |
static unsigned long int | sentPackets = 0 |
const char * | device_name = NULL |
enum frsky_state_t |
Enumerator | |
---|---|
SCANNING | |
SPORT | |
SPORT_SINGLE_WIRE | |
DTYPE |
Definition at line 79 of file frsky_telemetry.cpp.
int frsky_telemetry_main | ( | int | argc, |
char * | argv[] | ||
) |
The main command function.
Processes command line arguments and starts the daemon.
Definition at line 701 of file frsky_telemetry.cpp.
References device_name, DTYPE, frsky_state, frsky_task, frsky_telemetry_thread_main(), SCANNING, sentPackets, SPORT, SPORT_SINGLE_WIRE, thread_running, thread_should_exit, and usage().
|
static |
The daemon thread.
Definition at line 213 of file frsky_telemetry.cpp.
References adc_linkquality::ad1, adc_linkquality::ad2, vehicle_air_data_s::baro_alt_meter, device_name, dt, DTYPE, f(), frsky_deinit(), frsky_init(), frsky_parse_host(), frsky_send_frame1(), frsky_send_frame2(), frsky_send_frame3(), frsky_state, frsky_update_topics(), hrt_absolute_time(), hrt_abstime, adc_linkquality::linkq, orb_check(), orb_copy(), ORB_ID, orb_subscribe(), read(), SCANNING, sentPackets, set_uart_single_wire(), set_uart_speed(), SMARTPORT_POLL_1, SMARTPORT_POLL_2, SMARTPORT_POLL_3, SMARTPORT_POLL_4, SMARTPORT_POLL_5, SMARTPORT_POLL_6, SMARTPORT_POLL_7, SMARTPORT_POLL_8, SMARTPORT_SENSOR_ID_SP2UR, SPORT, sPort_deinit(), sPort_init(), sPort_open_uart(), sPort_send_ALT(), sPort_send_BATV(), sPort_send_CUR(), sPort_send_flight_mode(), sPort_send_FUEL(), sPort_send_GPS_ALT(), sPort_send_GPS_CRS(), sPort_send_GPS_FIX(), sPort_send_GPS_info(), sPort_send_GPS_LAT(), sPort_send_GPS_LON(), sPort_send_GPS_SPD(), sPort_send_GPS_TIME(), sPort_send_NAV_STATE(), sPort_send_SPD(), sPort_send_VSPD(), SPORT_SINGLE_WIRE, sPort_update_topics(), status, thread_running, thread_should_exit, and usage().
Referenced by frsky_telemetry_main().
uint16_t get_telemetry_flight_mode | ( | int | px4_flight_mode | ) |
Map the PX4 flight mode (vehicle_status_s::nav_state) to the telemetry flight mode.
Definition at line 94 of file frsky_telemetry.cpp.
Referenced by frsky_send_frame1(), and sPort_send_flight_mode().
|
static |
Definition at line 203 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_thread_main().
|
static |
Definition at line 189 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_thread_main().
|
static |
Opens the UART device and sets all required serial parameters.
Definition at line 135 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_thread_main().
|
static |
Print command usage information.
Definition at line 796 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), and frsky_telemetry_thread_main().
const char* device_name = NULL |
Definition at line 84 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), frsky_telemetry_thread_main(), GPS::instantiate(), and Mavlink::stream_command().
|
static |
Definition at line 80 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), and frsky_telemetry_thread_main().
|
static |
Definition at line 78 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main().
|
static |
Definition at line 82 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), and frsky_telemetry_thread_main().
|
static |
Definition at line 77 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), and frsky_telemetry_thread_main().
|
static |
Definition at line 76 of file frsky_telemetry.cpp.
Referenced by frsky_telemetry_main(), and frsky_telemetry_thread_main().