APM:Libraries
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
AP_Frsky_Telem Class Reference

#include <AP_Frsky_Telem.h>

Collaboration diagram for AP_Frsky_Telem:
[legend]

Public Member Functions

 AP_Frsky_Telem (AP_AHRS &ahrs, const AP_BattMonitor &battery, const RangeFinder &rng)
 
 AP_Frsky_Telem (const AP_Frsky_Telem &other)=delete
 
AP_Frsky_Telemoperator= (const AP_Frsky_Telem &)=delete
 
void init (const AP_SerialManager &serial_manager, const char *firmware_str, const uint8_t mav_type, const uint32_t *ap_valuep=nullptr)
 
void queue_message (MAV_SEVERITY severity, const char *text)
 
void update_control_mode (uint8_t mode)
 
void set_is_flying (bool is_flying)
 
void update_sensor_status_flags (uint32_t error_mask)
 

Static Public Attributes

static ObjectArray< mavlink_statustext_t > _statustext_queue
 

Private Member Functions

void send_SPort_Passthrough (void)
 
void send_SPort (void)
 
void send_D (void)
 
void tick (void)
 
void calc_crc (uint8_t byte)
 
void send_crc (void)
 
void send_byte (uint8_t value)
 
void send_uint32 (uint16_t id, uint32_t data)
 
void send_uint16 (uint16_t id, uint16_t data)
 
bool get_next_msg_chunk (void)
 
void check_sensor_status_flags (void)
 
void check_ekf_status (void)
 
uint32_t calc_param (void)
 
uint32_t calc_gps_latlng (bool *send_latitude)
 
uint32_t calc_gps_status (void)
 
uint32_t calc_batt (uint8_t instance)
 
uint32_t calc_ap_status (void)
 
uint32_t calc_home (void)
 
uint32_t calc_velandyaw (void)
 
uint32_t calc_attiandrng (void)
 
uint16_t prep_number (int32_t number, uint8_t digits, uint8_t power)
 
void calc_nav_alt (void)
 
float format_gps (float dec)
 
void calc_gps_position (void)
 

Private Attributes

AP_AHRS_ahrs
 
const AP_BattMonitor_battery
 
const RangeFinder_rng
 
AP_HAL::UARTDriver_port
 
AP_SerialManager::SerialProtocol _protocol
 
bool _initialised_uart
 
uint16_t _crc
 
struct {
   uint8_t   mav_type
 
_params
 
struct {
   uint8_t   control_mode
 
   uint32_t   value
 
   const uint32_t *   valuep
 
   uint32_t   sensor_status_flags
 
_ap
 
uint32_t check_sensor_status_timer
 
uint32_t check_ekf_status_timer
 
uint8_t _paramID
 
struct {
   char   lat_ns
 
   char   lon_ew
 
   uint16_t   latdddmm
 
   uint16_t   latmmmm
 
   uint16_t   londddmm
 
   uint16_t   lonmmmm
 
   uint16_t   alt_gps_meters
 
   uint16_t   alt_gps_cm
 
   uint16_t   alt_nav_meters
 
   uint16_t   alt_nav_cm
 
   int16_t   speed_in_meter
 
   uint16_t   speed_in_centimeter
 
_gps
 
struct {
   uint8_t   new_byte
 
   bool   send_attiandrng
 
   bool   send_latitude
 
   uint32_t   params_timer
 
   uint32_t   ap_status_timer
 
   uint32_t   batt_timer
 
   uint32_t   batt_timer2
 
   uint32_t   gps_status_timer
 
   uint32_t   home_timer
 
   uint32_t   velandyaw_timer
 
   uint32_t   gps_latlng_timer
 
_passthrough
 
struct {
   bool   sport_status
 
   uint8_t   fas_call
 
   uint8_t   gps_call
 
   uint8_t   vario_call
 
   uint8_t   various_call
 
_SPort
 
struct {
   uint32_t   last_200ms_frame
 
   uint32_t   last_1000ms_frame
 
_D
 
struct {
   uint32_t   chunk
 
   uint8_t   repeats
 
   uint8_t   char_index
 
_msg_chunk
 

Detailed Description

Definition at line 114 of file AP_Frsky_Telem.h.

Constructor & Destructor Documentation

◆ AP_Frsky_Telem() [1/2]

AP_Frsky_Telem::AP_Frsky_Telem ( AP_AHRS ahrs,
const AP_BattMonitor battery,
const RangeFinder rng 
)

Definition at line 30 of file AP_Frsky_Telem.cpp.

◆ AP_Frsky_Telem() [2/2]

AP_Frsky_Telem::AP_Frsky_Telem ( const AP_Frsky_Telem other)
delete

Member Function Documentation

◆ calc_ap_status()

uint32_t AP_Frsky_Telem::calc_ap_status ( void  )
private

Definition at line 672 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the caller graph for this function:

◆ calc_attiandrng()

uint32_t AP_Frsky_Telem::calc_attiandrng ( void  )
private

Definition at line 750 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_batt()

uint32_t AP_Frsky_Telem::calc_batt ( uint8_t  instance)
private

Definition at line 655 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_crc()

void AP_Frsky_Telem::calc_crc ( uint8_t  byte)
private

Definition at line 342 of file AP_Frsky_Telem.cpp.

Referenced by send_byte().

Here is the caller graph for this function:

◆ calc_gps_latlng()

uint32_t AP_Frsky_Telem::calc_gps_latlng ( bool *  send_latitude)
private

Definition at line 603 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_gps_position()

void AP_Frsky_Telem::calc_gps_position ( void  )
private

Definition at line 862 of file AP_Frsky_Telem.cpp.

Referenced by send_D(), and send_SPort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_gps_status()

uint32_t AP_Frsky_Telem::calc_gps_status ( void  )
private

Definition at line 631 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_home()

uint32_t AP_Frsky_Telem::calc_home ( void  )
private

Definition at line 695 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_nav_alt()

void AP_Frsky_Telem::calc_nav_alt ( void  )
private

Definition at line 832 of file AP_Frsky_Telem.cpp.

Referenced by send_D(), and send_SPort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_param()

uint32_t AP_Frsky_Telem::calc_param ( void  )
private

Definition at line 570 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_velandyaw()

uint32_t AP_Frsky_Telem::calc_velandyaw ( void  )
private

Definition at line 725 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_ekf_status()

void AP_Frsky_Telem::check_ekf_status ( void  )
private

Definition at line 532 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_sensor_status_flags()

void AP_Frsky_Telem::check_sensor_status_flags ( void  )
private

Definition at line 482 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ format_gps()

float AP_Frsky_Telem::format_gps ( float  dec)
private

Definition at line 852 of file AP_Frsky_Telem.cpp.

Referenced by calc_gps_position().

Here is the caller graph for this function:

◆ get_next_msg_chunk()

bool AP_Frsky_Telem::get_next_msg_chunk ( void  )
private

Definition at line 423 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void AP_Frsky_Telem::init ( const AP_SerialManager serial_manager,
const char *  firmware_str,
const uint8_t  mav_type,
const uint32_t *  ap_valuep = nullptr 
)

Definition at line 39 of file AP_Frsky_Telem.cpp.

Here is the call graph for this function:

◆ operator=()

AP_Frsky_Telem& AP_Frsky_Telem::operator= ( const AP_Frsky_Telem )
delete

◆ prep_number()

uint16_t AP_Frsky_Telem::prep_number ( int32_t  number,
uint8_t  digits,
uint8_t  power 
)
private

Definition at line 767 of file AP_Frsky_Telem.cpp.

Referenced by calc_attiandrng(), calc_batt(), calc_gps_status(), calc_home(), and calc_velandyaw().

Here is the caller graph for this function:

◆ queue_message()

void AP_Frsky_Telem::queue_message ( MAV_SEVERITY  severity,
const char *  text 
)

Definition at line 465 of file AP_Frsky_Telem.cpp.

Referenced by check_ekf_status(), check_sensor_status_flags(), init(), and GCS::send_statustext().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_byte()

void AP_Frsky_Telem::send_byte ( uint8_t  value)
private

Definition at line 363 of file AP_Frsky_Telem.cpp.

Referenced by send_crc(), send_uint16(), and send_uint32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_crc()

void AP_Frsky_Telem::send_crc ( void  )
private

Definition at line 353 of file AP_Frsky_Telem.cpp.

Referenced by send_uint32().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_D()

void AP_Frsky_Telem::send_D ( void  )
private

Definition at line 278 of file AP_Frsky_Telem.cpp.

Referenced by tick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_SPort()

void AP_Frsky_Telem::send_SPort ( void  )
private

Definition at line 167 of file AP_Frsky_Telem.cpp.

Referenced by tick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_SPort_Passthrough()

void AP_Frsky_Telem::send_SPort_Passthrough ( void  )
private

Definition at line 74 of file AP_Frsky_Telem.cpp.

Referenced by tick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_uint16()

void AP_Frsky_Telem::send_uint16 ( uint16_t  id,
uint16_t  data 
)
private

Definition at line 409 of file AP_Frsky_Telem.cpp.

Referenced by send_D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_uint32()

void AP_Frsky_Telem::send_uint32 ( uint16_t  id,
uint32_t  data 
)
private

Definition at line 392 of file AP_Frsky_Telem.cpp.

Referenced by send_SPort(), and send_SPort_Passthrough().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_is_flying()

void AP_Frsky_Telem::set_is_flying ( bool  is_flying)
inline

Definition at line 134 of file AP_Frsky_Telem.h.

◆ tick()

void AP_Frsky_Telem::tick ( void  )
private

Definition at line 316 of file AP_Frsky_Telem.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_control_mode()

void AP_Frsky_Telem::update_control_mode ( uint8_t  mode)
inline

Definition at line 129 of file AP_Frsky_Telem.h.

◆ update_sensor_status_flags()

void AP_Frsky_Telem::update_sensor_status_flags ( uint32_t  error_mask)
inline

Definition at line 140 of file AP_Frsky_Telem.h.

Member Data Documentation

◆ _ahrs

AP_AHRS& AP_Frsky_Telem::_ahrs
private

◆ _ap

struct { ... } AP_Frsky_Telem::_ap

◆ _battery

const AP_BattMonitor& AP_Frsky_Telem::_battery
private

Definition at line 146 of file AP_Frsky_Telem.h.

Referenced by calc_batt(), calc_param(), send_D(), send_SPort(), and send_SPort_Passthrough().

◆ _crc

uint16_t AP_Frsky_Telem::_crc
private

Definition at line 151 of file AP_Frsky_Telem.h.

Referenced by calc_crc(), and send_crc().

◆ _D

struct { ... } AP_Frsky_Telem::_D

Referenced by send_D().

◆ _gps

struct { ... } AP_Frsky_Telem::_gps

◆ _initialised_uart

bool AP_Frsky_Telem::_initialised_uart
private

Definition at line 150 of file AP_Frsky_Telem.h.

Referenced by tick().

◆ _msg_chunk

struct { ... } AP_Frsky_Telem::_msg_chunk

◆ _paramID

uint8_t AP_Frsky_Telem::_paramID
private

Definition at line 168 of file AP_Frsky_Telem.h.

Referenced by calc_param().

◆ _params

struct { ... } AP_Frsky_Telem::_params

Referenced by calc_param(), and init().

◆ _passthrough

struct { ... } AP_Frsky_Telem::_passthrough

Referenced by send_SPort_Passthrough().

◆ _port

AP_HAL::UARTDriver* AP_Frsky_Telem::_port
private

Definition at line 148 of file AP_Frsky_Telem.h.

Referenced by init(), send_byte(), send_SPort(), send_SPort_Passthrough(), send_uint16(), and tick().

◆ _protocol

AP_SerialManager::SerialProtocol AP_Frsky_Telem::_protocol
private

Definition at line 149 of file AP_Frsky_Telem.h.

Referenced by init(), send_byte(), and tick().

◆ _rng

const RangeFinder& AP_Frsky_Telem::_rng
private

Definition at line 147 of file AP_Frsky_Telem.h.

Referenced by calc_attiandrng().

◆ _SPort

struct { ... } AP_Frsky_Telem::_SPort

Referenced by send_SPort().

◆ _statustext_queue

ObjectArray< mavlink_statustext_t > AP_Frsky_Telem::_statustext_queue
static

Definition at line 142 of file AP_Frsky_Telem.h.

Referenced by get_next_msg_chunk(), and queue_message().

◆ alt_gps_cm

uint16_t AP_Frsky_Telem::alt_gps_cm

Definition at line 178 of file AP_Frsky_Telem.h.

◆ alt_gps_meters

uint16_t AP_Frsky_Telem::alt_gps_meters

Definition at line 177 of file AP_Frsky_Telem.h.

◆ alt_nav_cm

uint16_t AP_Frsky_Telem::alt_nav_cm

Definition at line 180 of file AP_Frsky_Telem.h.

◆ alt_nav_meters

uint16_t AP_Frsky_Telem::alt_nav_meters

Definition at line 179 of file AP_Frsky_Telem.h.

◆ ap_status_timer

uint32_t AP_Frsky_Telem::ap_status_timer

Definition at line 191 of file AP_Frsky_Telem.h.

◆ batt_timer

uint32_t AP_Frsky_Telem::batt_timer

Definition at line 192 of file AP_Frsky_Telem.h.

◆ batt_timer2

uint32_t AP_Frsky_Telem::batt_timer2

Definition at line 193 of file AP_Frsky_Telem.h.

◆ char_index

uint8_t AP_Frsky_Telem::char_index

Definition at line 219 of file AP_Frsky_Telem.h.

◆ check_ekf_status_timer

uint32_t AP_Frsky_Telem::check_ekf_status_timer
private

Definition at line 167 of file AP_Frsky_Telem.h.

Referenced by check_ekf_status().

◆ check_sensor_status_timer

uint32_t AP_Frsky_Telem::check_sensor_status_timer
private

Definition at line 166 of file AP_Frsky_Telem.h.

Referenced by check_sensor_status_flags().

◆ chunk

uint32_t AP_Frsky_Telem::chunk

Definition at line 217 of file AP_Frsky_Telem.h.

◆ control_mode

uint8_t AP_Frsky_Telem::control_mode

Definition at line 160 of file AP_Frsky_Telem.h.

◆ fas_call

uint8_t AP_Frsky_Telem::fas_call

Definition at line 203 of file AP_Frsky_Telem.h.

◆ gps_call

uint8_t AP_Frsky_Telem::gps_call

Definition at line 204 of file AP_Frsky_Telem.h.

◆ gps_latlng_timer

uint32_t AP_Frsky_Telem::gps_latlng_timer

Definition at line 197 of file AP_Frsky_Telem.h.

◆ gps_status_timer

uint32_t AP_Frsky_Telem::gps_status_timer

Definition at line 194 of file AP_Frsky_Telem.h.

◆ home_timer

uint32_t AP_Frsky_Telem::home_timer

Definition at line 195 of file AP_Frsky_Telem.h.

◆ last_1000ms_frame

uint32_t AP_Frsky_Telem::last_1000ms_frame

Definition at line 212 of file AP_Frsky_Telem.h.

◆ last_200ms_frame

uint32_t AP_Frsky_Telem::last_200ms_frame

Definition at line 211 of file AP_Frsky_Telem.h.

◆ lat_ns

char AP_Frsky_Telem::lat_ns

Definition at line 172 of file AP_Frsky_Telem.h.

◆ latdddmm

uint16_t AP_Frsky_Telem::latdddmm

Definition at line 173 of file AP_Frsky_Telem.h.

◆ latmmmm

uint16_t AP_Frsky_Telem::latmmmm

Definition at line 174 of file AP_Frsky_Telem.h.

◆ lon_ew

char AP_Frsky_Telem::lon_ew

Definition at line 172 of file AP_Frsky_Telem.h.

◆ londddmm

uint16_t AP_Frsky_Telem::londddmm

Definition at line 175 of file AP_Frsky_Telem.h.

◆ lonmmmm

uint16_t AP_Frsky_Telem::lonmmmm

Definition at line 176 of file AP_Frsky_Telem.h.

◆ mav_type

uint8_t AP_Frsky_Telem::mav_type

Definition at line 155 of file AP_Frsky_Telem.h.

Referenced by init().

◆ new_byte

uint8_t AP_Frsky_Telem::new_byte

Definition at line 187 of file AP_Frsky_Telem.h.

◆ params_timer

uint32_t AP_Frsky_Telem::params_timer

Definition at line 190 of file AP_Frsky_Telem.h.

◆ repeats

uint8_t AP_Frsky_Telem::repeats

Definition at line 218 of file AP_Frsky_Telem.h.

◆ send_attiandrng

bool AP_Frsky_Telem::send_attiandrng

Definition at line 188 of file AP_Frsky_Telem.h.

◆ send_latitude

bool AP_Frsky_Telem::send_latitude

Definition at line 189 of file AP_Frsky_Telem.h.

◆ sensor_status_flags

uint32_t AP_Frsky_Telem::sensor_status_flags

Definition at line 163 of file AP_Frsky_Telem.h.

◆ speed_in_centimeter

uint16_t AP_Frsky_Telem::speed_in_centimeter

Definition at line 182 of file AP_Frsky_Telem.h.

◆ speed_in_meter

int16_t AP_Frsky_Telem::speed_in_meter

Definition at line 181 of file AP_Frsky_Telem.h.

◆ sport_status

bool AP_Frsky_Telem::sport_status

Definition at line 202 of file AP_Frsky_Telem.h.

◆ value

uint32_t AP_Frsky_Telem::value

Definition at line 161 of file AP_Frsky_Telem.h.

◆ valuep

const uint32_t* AP_Frsky_Telem::valuep

Definition at line 162 of file AP_Frsky_Telem.h.

◆ vario_call

uint8_t AP_Frsky_Telem::vario_call

Definition at line 205 of file AP_Frsky_Telem.h.

◆ various_call

uint8_t AP_Frsky_Telem::various_call

Definition at line 206 of file AP_Frsky_Telem.h.

◆ velandyaw_timer

uint32_t AP_Frsky_Telem::velandyaw_timer

Definition at line 196 of file AP_Frsky_Telem.h.


The documentation for this class was generated from the following files: