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

#include <AP_ADSB.h>

Collaboration diagram for AP_ADSB:
[legend]

Classes

struct  adsb_vehicle_t
 

Public Member Functions

 AP_ADSB ()
 
 AP_ADSB (const AP_ADSB &other)=delete
 
AP_ADSBoperator= (const AP_ADSB &)=delete
 
void update (void)
 
uint16_t get_vehicle_count ()
 
void send_adsb_vehicle (mavlink_channel_t chan)
 
void set_stall_speed_cm (const uint16_t stall_speed_cm)
 
void set_max_speed (int16_t max_speed)
 
void set_is_auto_mode (const bool is_in_auto_mode)
 
void set_is_flying (const bool is_flying)
 
UAVIONIX_ADSB_RF_HEALTH get_transceiver_status (void)
 
Location_Class get_location (const adsb_vehicle_t &vehicle) const
 
bool enabled () const
 
bool next_sample (adsb_vehicle_t &obstacle)
 
void handle_message (const mavlink_channel_t chan, const mavlink_message_t *msg)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void init ()
 
void deinit ()
 
void determine_furthest_aircraft (void)
 
bool find_index (const adsb_vehicle_t &vehicle, uint16_t *index) const
 
void delete_vehicle (const uint16_t index)
 
void set_vehicle (const uint16_t index, const adsb_vehicle_t &vehicle)
 
uint32_t genICAO (const Location_Class &loc)
 
void set_callsign (const char *str, const bool append_icao)
 
void send_configure (const mavlink_channel_t chan)
 
void send_dynamic_out (const mavlink_channel_t chan)
 
uint32_t get_encoded_icao (void)
 
uint8_t get_encoded_callsign_null_char (void)
 
void handle_vehicle (const mavlink_message_t *msg)
 
void handle_transceiver_report (mavlink_channel_t chan, const mavlink_message_t *msg)
 
void handle_out_cfg (const mavlink_message_t *msg)
 
void push_sample (adsb_vehicle_t &vehicle)
 

Private Attributes

AP_Int8 _enabled
 
Location_Class _my_loc
 
struct {
   AP_Int16   list_size_param
 
   uint16_t   list_size = 1
 
   adsb_vehicle_t *   vehicle_list = nullptr
 
   uint16_t   vehicle_count
 
   AP_Int32   list_radius
 
   uint32_t   send_start_ms [MAVLINK_COMM_NUM_BUFFERS]
 
   uint16_t   send_index [MAVLINK_COMM_NUM_BUFFERS]
 
in_state
 
struct {
   uint32_t   last_config_ms
 
   uint32_t   last_report_ms
 
   int8_t   chan = -1
 
   uint32_t   chan_last_ms
 
   UAVIONIX_ADSB_RF_HEALTH   status
 
   bool   is_flying
 
   bool   _is_in_auto_mode
 
   struct {
      int32_t   ICAO_id
 
      AP_Int32   ICAO_id_param
 
      int32_t   ICAO_id_param_prev = -1
 
      char   callsign [MAVLINK_MSG_UAVIONIX_ADSB_OUT_CFG_FIELD_CALLSIGN_LEN]
 
      AP_Int8   emitterType
 
      AP_Int8   lengthWidth
 
      AP_Int8   gpsLatOffset
 
      AP_Int8   gpsLonOffset
 
      uint16_t   stall_speed_cm
 
      AP_Int8   rfSelect
 
      AP_Int16   squawk_octal_param
 
      uint16_t   squawk_octal
 
      float   maxAircraftSpeed_knots
 
      AP_Int8   rf_capable
 
      bool   was_set_externally
 
   }   cfg
 
out_state
 
uint16_t furthest_vehicle_index
 
float furthest_vehicle_distance
 
AP_Buffer< adsb_vehicle_t, max_samplessamples
 

Static Private Attributes

static const uint8_t max_samples = 30
 

Detailed Description

Definition at line 32 of file AP_ADSB.h.

Constructor & Destructor Documentation

◆ AP_ADSB() [1/2]

AP_ADSB::AP_ADSB ( )
inline

Definition at line 34 of file AP_ADSB.h.

Here is the call graph for this function:

◆ AP_ADSB() [2/2]

AP_ADSB::AP_ADSB ( const AP_ADSB other)
delete

Member Function Documentation

◆ deinit()

void AP_ADSB::deinit ( void  )
private

Definition at line 167 of file AP_ADSB.cpp.

Referenced by enabled(), and update().

Here is the caller graph for this function:

◆ delete_vehicle()

void AP_ADSB::delete_vehicle ( const uint16_t  index)
private

Definition at line 317 of file AP_ADSB.cpp.

Referenced by enabled(), handle_vehicle(), and update().

Here is the caller graph for this function:

◆ determine_furthest_aircraft()

void AP_ADSB::determine_furthest_aircraft ( void  )
private

Definition at line 282 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_vehicle().

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

◆ enabled()

bool AP_ADSB::enabled ( ) const
inline

Definition at line 75 of file AP_ADSB.h.

Referenced by AP_Avoidance::update().

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

◆ find_index()

bool AP_ADSB::find_index ( const adsb_vehicle_t vehicle,
uint16_t *  index 
) const
private

Definition at line 339 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_vehicle().

Here is the caller graph for this function:

◆ genICAO()

uint32_t AP_ADSB::genICAO ( const Location_Class loc)
private

Definition at line 742 of file AP_ADSB.cpp.

Referenced by enabled(), and update().

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

◆ get_encoded_callsign_null_char()

uint8_t AP_ADSB::get_encoded_callsign_null_char ( void  )
private

Definition at line 594 of file AP_ADSB.cpp.

Referenced by enabled(), and send_configure().

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

◆ get_encoded_icao()

uint32_t AP_ADSB::get_encoded_icao ( void  )
private

Definition at line 571 of file AP_ADSB.cpp.

Referenced by enabled(), and send_configure().

Here is the caller graph for this function:

◆ get_location()

Location_Class AP_ADSB::get_location ( const adsb_vehicle_t vehicle) const

Definition at line 302 of file AP_ADSB.cpp.

Referenced by determine_furthest_aircraft(), AP_Avoidance::get_adsb_samples(), get_transceiver_status(), and handle_vehicle().

Here is the caller graph for this function:

◆ get_transceiver_status()

UAVIONIX_ADSB_RF_HEALTH AP_ADSB::get_transceiver_status ( void  )
inline

Definition at line 70 of file AP_ADSB.h.

Here is the call graph for this function:

◆ get_vehicle_count()

uint16_t AP_ADSB::get_vehicle_count ( )
inline

Definition at line 54 of file AP_ADSB.h.

Here is the call graph for this function:

◆ handle_message()

void AP_ADSB::handle_message ( const mavlink_channel_t  chan,
const mavlink_message_t *  msg 
)

Definition at line 815 of file AP_ADSB.cpp.

Referenced by enabled().

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

◆ handle_out_cfg()

void AP_ADSB::handle_out_cfg ( const mavlink_message_t *  msg)
private

Definition at line 654 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_message().

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

◆ handle_transceiver_report()

void AP_ADSB::handle_transceiver_report ( mavlink_channel_t  chan,
const mavlink_message_t *  msg 
)
private

Definition at line 722 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_message().

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

◆ handle_vehicle()

void AP_ADSB::handle_vehicle ( const mavlink_message_t *  msg)
private

Definition at line 354 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_message().

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

◆ init()

void AP_ADSB::init ( void  )
private

Definition at line 138 of file AP_ADSB.cpp.

Referenced by enabled(), and update().

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

◆ next_sample()

bool AP_ADSB::next_sample ( adsb_vehicle_t obstacle)

Definition at line 810 of file AP_ADSB.cpp.

Referenced by enabled(), and AP_Avoidance::get_adsb_samples().

Here is the caller graph for this function:

◆ operator=()

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

Referenced by AP_ADSB().

Here is the caller graph for this function:

◆ push_sample()

void AP_ADSB::push_sample ( adsb_vehicle_t vehicle)
private

Definition at line 805 of file AP_ADSB.cpp.

Referenced by handle_vehicle().

Here is the caller graph for this function:

◆ send_adsb_vehicle()

void AP_ADSB::send_adsb_vehicle ( mavlink_channel_t  chan)

Definition at line 448 of file AP_ADSB.cpp.

Referenced by get_vehicle_count().

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

◆ send_configure()

void AP_ADSB::send_configure ( const mavlink_channel_t  chan)
private

Definition at line 687 of file AP_ADSB.cpp.

Referenced by enabled(), and update().

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

◆ send_dynamic_out()

void AP_ADSB::send_dynamic_out ( const mavlink_channel_t  chan)
private

Definition at line 490 of file AP_ADSB.cpp.

Referenced by enabled(), and update().

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

◆ set_callsign()

void AP_ADSB::set_callsign ( const char *  str,
const bool  append_icao 
)
private

Definition at line 759 of file AP_ADSB.cpp.

Referenced by enabled(), init(), and update().

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

◆ set_is_auto_mode()

void AP_ADSB::set_is_auto_mode ( const bool  is_in_auto_mode)
inline

Definition at line 67 of file AP_ADSB.h.

◆ set_is_flying()

void AP_ADSB::set_is_flying ( const bool  is_flying)
inline

Definition at line 68 of file AP_ADSB.h.

◆ set_max_speed()

void AP_ADSB::set_max_speed ( int16_t  max_speed)
inline

Definition at line 60 of file AP_ADSB.h.

◆ set_stall_speed_cm()

void AP_ADSB::set_stall_speed_cm ( const uint16_t  stall_speed_cm)
inline

Definition at line 59 of file AP_ADSB.h.

◆ set_vehicle()

void AP_ADSB::set_vehicle ( const uint16_t  index,
const adsb_vehicle_t vehicle 
)
private

Definition at line 441 of file AP_ADSB.cpp.

Referenced by enabled(), and handle_vehicle().

Here is the caller graph for this function:

◆ update()

void AP_ADSB::update ( void  )

Definition at line 179 of file AP_ADSB.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _enabled

AP_Int8 AP_ADSB::_enabled
private

Definition at line 123 of file AP_ADSB.h.

Referenced by enabled(), init(), and update().

◆ _is_in_auto_mode

bool AP_ADSB::_is_in_auto_mode

Definition at line 151 of file AP_ADSB.h.

◆ _my_loc

Location_Class AP_ADSB::_my_loc
private

Definition at line 125 of file AP_ADSB.h.

Referenced by determine_furthest_aircraft(), handle_vehicle(), send_dynamic_out(), and update().

◆ callsign

char AP_ADSB::callsign[MAVLINK_MSG_UAVIONIX_ADSB_OUT_CFG_FIELD_CALLSIGN_LEN]

Definition at line 158 of file AP_ADSB.h.

Referenced by send_configure().

◆ cfg

struct { ... } AP_ADSB::cfg

◆ chan

int8_t AP_ADSB::chan = -1

Definition at line 147 of file AP_ADSB.h.

Referenced by get_vehicle_count(), handle_transceiver_report(), send_adsb_vehicle(), and update().

◆ chan_last_ms

uint32_t AP_ADSB::chan_last_ms

Definition at line 148 of file AP_ADSB.h.

◆ emitterType

AP_Int8 AP_ADSB::emitterType

Definition at line 159 of file AP_ADSB.h.

◆ furthest_vehicle_distance

float AP_ADSB::furthest_vehicle_distance
private

Definition at line 177 of file AP_ADSB.h.

Referenced by delete_vehicle(), determine_furthest_aircraft(), handle_vehicle(), and init().

◆ furthest_vehicle_index

uint16_t AP_ADSB::furthest_vehicle_index
private

Definition at line 176 of file AP_ADSB.h.

Referenced by delete_vehicle(), determine_furthest_aircraft(), handle_vehicle(), and init().

◆ gpsLatOffset

AP_Int8 AP_ADSB::gpsLatOffset

Definition at line 161 of file AP_ADSB.h.

◆ gpsLonOffset

AP_Int8 AP_ADSB::gpsLonOffset

Definition at line 162 of file AP_ADSB.h.

◆ ICAO_id

int32_t AP_ADSB::ICAO_id

Definition at line 155 of file AP_ADSB.h.

◆ ICAO_id_param

AP_Int32 AP_ADSB::ICAO_id_param

Definition at line 156 of file AP_ADSB.h.

◆ ICAO_id_param_prev

int32_t AP_ADSB::ICAO_id_param_prev = -1

Definition at line 157 of file AP_ADSB.h.

◆ in_state

struct { ... } AP_ADSB::in_state

◆ is_flying

bool AP_ADSB::is_flying

Definition at line 150 of file AP_ADSB.h.

Referenced by set_is_flying().

◆ last_config_ms

uint32_t AP_ADSB::last_config_ms

Definition at line 145 of file AP_ADSB.h.

◆ last_report_ms

uint32_t AP_ADSB::last_report_ms

Definition at line 146 of file AP_ADSB.h.

◆ lengthWidth

AP_Int8 AP_ADSB::lengthWidth

Definition at line 160 of file AP_ADSB.h.

◆ list_radius

AP_Int32 AP_ADSB::list_radius

Definition at line 135 of file AP_ADSB.h.

◆ list_size

uint16_t AP_ADSB::list_size = 1

Definition at line 132 of file AP_ADSB.h.

◆ list_size_param

AP_Int16 AP_ADSB::list_size_param

Definition at line 131 of file AP_ADSB.h.

◆ max_samples

const uint8_t AP_ADSB::max_samples = 30
staticprivate

Definition at line 179 of file AP_ADSB.h.

◆ maxAircraftSpeed_knots

float AP_ADSB::maxAircraftSpeed_knots

Definition at line 167 of file AP_ADSB.h.

◆ out_state

struct { ... } AP_ADSB::out_state

◆ rf_capable

AP_Int8 AP_ADSB::rf_capable

Definition at line 168 of file AP_ADSB.h.

◆ rfSelect

AP_Int8 AP_ADSB::rfSelect

Definition at line 164 of file AP_ADSB.h.

◆ samples

AP_Buffer<adsb_vehicle_t, max_samples> AP_ADSB::samples
private

Definition at line 180 of file AP_ADSB.h.

Referenced by next_sample(), and push_sample().

◆ send_index

uint16_t AP_ADSB::send_index[MAVLINK_COMM_NUM_BUFFERS]

Definition at line 139 of file AP_ADSB.h.

◆ send_start_ms

uint32_t AP_ADSB::send_start_ms[MAVLINK_COMM_NUM_BUFFERS]

Definition at line 138 of file AP_ADSB.h.

◆ squawk_octal

uint16_t AP_ADSB::squawk_octal

Definition at line 166 of file AP_ADSB.h.

◆ squawk_octal_param

AP_Int16 AP_ADSB::squawk_octal_param

Definition at line 165 of file AP_ADSB.h.

◆ stall_speed_cm

uint16_t AP_ADSB::stall_speed_cm

Definition at line 163 of file AP_ADSB.h.

Referenced by set_stall_speed_cm().

◆ status

UAVIONIX_ADSB_RF_HEALTH AP_ADSB::status

Definition at line 149 of file AP_ADSB.h.

◆ var_info

const AP_Param::GroupInfo AP_ADSB::var_info
static

Definition at line 49 of file AP_ADSB.h.

Referenced by AP_ADSB().

◆ vehicle_count

uint16_t AP_ADSB::vehicle_count

Definition at line 134 of file AP_ADSB.h.

◆ vehicle_list

adsb_vehicle_t* AP_ADSB::vehicle_list = nullptr

Definition at line 133 of file AP_ADSB.h.

◆ was_set_externally

bool AP_ADSB::was_set_externally

Definition at line 169 of file AP_ADSB.h.


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