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

#include <AP_GPS_SBP2.h>

Inheritance diagram for AP_GPS_SBP2:
[legend]
Collaboration diagram for AP_GPS_SBP2:
[legend]

Classes

struct  sbp_dops_t
 
struct  sbp_ext_event_t
 
struct  sbp_gps_time_t
 
struct  sbp_heartbeat_t
 
struct  sbp_parser_state_t
 
struct  sbp_pos_llh_t
 
struct  sbp_vel_ned_t
 

Public Member Functions

 AP_GPS_SBP2 (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
AP_GPS::GPS_Status highest_supported_status (void) override
 
bool read () override
 
void inject_data (const uint8_t *data, uint16_t len) override
 
const char * name () const override
 
- Public Member Functions inherited from AP_GPS_Backend
 AP_GPS_Backend (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
virtual ~AP_GPS_Backend (void)
 
virtual bool is_configured (void)
 
virtual bool supports_mavlink_gps_rtk_message ()
 
virtual void send_mavlink_gps_rtk (mavlink_channel_t chan)
 
virtual void broadcast_configuration_failure_reason (void) const
 
virtual void handle_msg (const mavlink_message_t *msg)
 
virtual void handle_gnss_msg (const AP_GPS::GPS_State &msg)
 
virtual bool get_lag (float &lag) const
 
virtual bool is_healthy (void) const
 
void broadcast_gps_type () const
 
virtual void Write_DataFlash_Log_Startup_messages () const
 
virtual bool prepare_for_arming (void)
 

Static Public Member Functions

static bool _detect (struct SBP2_detect_state &state, uint8_t data)
 

Private Member Functions

void _sbp_process ()
 
void _sbp_process_message ()
 
bool _attempt_state_update ()
 
void logging_log_full_update ()
 
void logging_ext_event ()
 
void logging_log_raw_sbp (uint16_t msg_type, uint16_t sender_id, uint8_t msg_len, uint8_t *msg_buff)
 
int32_t distMod (int32_t tow1_ms, int32_t tow2_ms, int32_t mod)
 

Private Attributes

struct AP_GPS_SBP2::sbp_parser_state_t parser_state
 
uint32_t last_heartbeat_received_ms
 
uint32_t last_injected_data_ms
 
struct sbp_heartbeat_t last_heartbeat
 
struct sbp_gps_time_t last_gps_time
 
struct sbp_dops_t last_dops
 
struct sbp_pos_llh_t last_pos_llh
 
struct sbp_vel_ned_t last_vel_ned
 
struct sbp_ext_event_t last_event
 
uint32_t last_full_update_tow
 
uint16_t last_full_update_wn
 
uint32_t crc_error_counter
 

Static Private Attributes

static const uint8_t SBP_PREAMBLE = 0x55
 
static const uint16_t SBP_STARTUP_MSGTYPE = 0xFF00
 
static const uint16_t SBP_HEARTBEAT_MSGTYPE = 0xFFFF
 
static const uint16_t SBP_GPS_TIME_MSGTYPE = 0x0102
 
static const uint16_t SBP_DOPS_MSGTYPE = 0x0208
 
static const uint16_t SBP_POS_ECEF_MSGTYPE = 0x0209
 
static const uint16_t SBP_POS_LLH_MSGTYPE = 0x020A
 
static const uint16_t SBP_BASELINE_ECEF_MSGTYPE = 0x020B
 
static const uint16_t SBP_BASELINE_NED_MSGTYPE = 0x020C
 
static const uint16_t SBP_VEL_ECEF_MSGTYPE = 0x020D
 
static const uint16_t SBP_VEL_NED_MSGTYPE = 0x020E
 
static const uint16_t SBP_TRACKING_STATE_MSGTYPE = 0x0013
 
static const uint16_t SBP_IAR_STATE_MSGTYPE = 0x0019
 
static const uint16_t SBP_EXT_EVENT_MSGTYPE = 0x0101
 

Additional Inherited Members

- Protected Member Functions inherited from AP_GPS_Backend
int32_t swap_int32 (int32_t v) const
 
int16_t swap_int16 (int16_t v) const
 
void fill_3d_velocity (void)
 
void make_gps_time (uint32_t bcd_date, uint32_t bcd_milliseconds)
 
void _detection_message (char *buffer, uint8_t buflen) const
 
bool should_df_log () const
 
- Protected Attributes inherited from AP_GPS_Backend
AP_HAL::UARTDriverport
 UART we are attached to. More...
 
AP_GPSgps
 access to frontend (for parameters) More...
 
AP_GPS::GPS_Statestate
 public state for this instance More...
 

Detailed Description

Definition at line 27 of file AP_GPS_SBP2.h.

Constructor & Destructor Documentation

◆ AP_GPS_SBP2()

AP_GPS_SBP2::AP_GPS_SBP2 ( AP_GPS _gps,
AP_GPS::GPS_State _state,
AP_HAL::UARTDriver _port 
)

Definition at line 61 of file AP_GPS_SBP2.cpp.

Member Function Documentation

◆ _attempt_state_update()

bool AP_GPS_SBP2::_attempt_state_update ( )
private

Definition at line 222 of file AP_GPS_SBP2.cpp.

Referenced by read().

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

◆ _detect()

bool AP_GPS_SBP2::_detect ( struct SBP2_detect_state state,
uint8_t  data 
)
static

Definition at line 359 of file AP_GPS_SBP2.cpp.

Referenced by AP_GPS::detect_instance(), and highest_supported_status().

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

◆ _sbp_process()

void AP_GPS_SBP2::_sbp_process ( )
private

Definition at line 97 of file AP_GPS_SBP2.cpp.

Referenced by read().

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

◆ _sbp_process_message()

void AP_GPS_SBP2::_sbp_process_message ( )
private

Definition at line 177 of file AP_GPS_SBP2.cpp.

Referenced by _sbp_process().

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

◆ distMod()

int32_t AP_GPS_SBP2::distMod ( int32_t  tow1_ms,
int32_t  tow2_ms,
int32_t  mod 
)
private

Definition at line 217 of file AP_GPS_SBP2.cpp.

Referenced by _attempt_state_update().

Here is the caller graph for this function:

◆ highest_supported_status()

AP_GPS::GPS_Status AP_GPS_SBP2::highest_supported_status ( void  )
inlineoverridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 32 of file AP_GPS_SBP2.h.

Here is the call graph for this function:

◆ inject_data()

void AP_GPS_SBP2::inject_data ( const uint8_t *  data,
uint16_t  len 
)
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 84 of file AP_GPS_SBP2.cpp.

Referenced by highest_supported_status().

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

◆ logging_ext_event()

void AP_GPS_SBP2::logging_ext_event ( )
private

Definition at line 501 of file AP_GPS_SBP2.cpp.

Referenced by _sbp_process_message().

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

◆ logging_log_full_update()

void AP_GPS_SBP2::logging_log_full_update ( )
private

Definition at line 433 of file AP_GPS_SBP2.cpp.

Here is the call graph for this function:

◆ logging_log_raw_sbp()

void AP_GPS_SBP2::logging_log_raw_sbp ( uint16_t  msg_type,
uint16_t  sender_id,
uint8_t  msg_len,
uint8_t *  msg_buff 
)
private

Definition at line 453 of file AP_GPS_SBP2.cpp.

Referenced by _sbp_process_message().

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

◆ name()

const char* AP_GPS_SBP2::name ( ) const
inlineoverridevirtual

Implements AP_GPS_Backend.

Definition at line 41 of file AP_GPS_SBP2.h.

◆ read()

bool AP_GPS_SBP2::read ( void  )
overridevirtual

Implements AP_GPS_Backend.

Definition at line 72 of file AP_GPS_SBP2.cpp.

Referenced by highest_supported_status().

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

Member Data Documentation

◆ crc_error_counter

uint32_t AP_GPS_SBP2::crc_error_counter
private

Definition at line 188 of file AP_GPS_SBP2.h.

Referenced by _sbp_process(), and logging_log_full_update().

◆ last_dops

struct sbp_dops_t AP_GPS_SBP2::last_dops
private

Definition at line 176 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ last_event

struct sbp_ext_event_t AP_GPS_SBP2::last_event
private

Definition at line 179 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message(), and logging_ext_event().

◆ last_full_update_tow

uint32_t AP_GPS_SBP2::last_full_update_tow
private

Definition at line 181 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update().

◆ last_full_update_wn

uint16_t AP_GPS_SBP2::last_full_update_wn
private

Definition at line 182 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update().

◆ last_gps_time

struct sbp_gps_time_t AP_GPS_SBP2::last_gps_time
private

Definition at line 175 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ last_heartbeat

struct sbp_heartbeat_t AP_GPS_SBP2::last_heartbeat
private

Definition at line 174 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ last_heartbeat_received_ms

uint32_t AP_GPS_SBP2::last_heartbeat_received_ms
private

Definition at line 171 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ last_injected_data_ms

uint32_t AP_GPS_SBP2::last_injected_data_ms
private

Definition at line 172 of file AP_GPS_SBP2.h.

Referenced by inject_data(), and logging_log_full_update().

◆ last_pos_llh

struct sbp_pos_llh_t AP_GPS_SBP2::last_pos_llh
private

Definition at line 177 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ last_vel_ned

struct sbp_vel_ned_t AP_GPS_SBP2::last_vel_ned
private

Definition at line 178 of file AP_GPS_SBP2.h.

Referenced by _attempt_state_update(), and _sbp_process_message().

◆ parser_state

struct AP_GPS_SBP2::sbp_parser_state_t AP_GPS_SBP2::parser_state
private

◆ SBP_BASELINE_ECEF_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_BASELINE_ECEF_MSGTYPE = 0x020B
staticprivate

Definition at line 75 of file AP_GPS_SBP2.h.

◆ SBP_BASELINE_NED_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_BASELINE_NED_MSGTYPE = 0x020C
staticprivate

Definition at line 76 of file AP_GPS_SBP2.h.

◆ SBP_DOPS_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_DOPS_MSGTYPE = 0x0208
staticprivate

Definition at line 72 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message().

◆ SBP_EXT_EVENT_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_EXT_EVENT_MSGTYPE = 0x0101
staticprivate

Definition at line 81 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message().

◆ SBP_GPS_TIME_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_GPS_TIME_MSGTYPE = 0x0102
staticprivate

Definition at line 71 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message().

◆ SBP_HEARTBEAT_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_HEARTBEAT_MSGTYPE = 0xFFFF
staticprivate

Definition at line 70 of file AP_GPS_SBP2.h.

Referenced by _detect(), and _sbp_process_message().

◆ SBP_IAR_STATE_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_IAR_STATE_MSGTYPE = 0x0019
staticprivate

Definition at line 80 of file AP_GPS_SBP2.h.

◆ SBP_POS_ECEF_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_POS_ECEF_MSGTYPE = 0x0209
staticprivate

Definition at line 73 of file AP_GPS_SBP2.h.

◆ SBP_POS_LLH_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_POS_LLH_MSGTYPE = 0x020A
staticprivate

Definition at line 74 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message().

◆ SBP_PREAMBLE

const uint8_t AP_GPS_SBP2::SBP_PREAMBLE = 0x55
staticprivate

Definition at line 66 of file AP_GPS_SBP2.h.

Referenced by _detect(), and _sbp_process().

◆ SBP_STARTUP_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_STARTUP_MSGTYPE = 0xFF00
staticprivate

Definition at line 69 of file AP_GPS_SBP2.h.

◆ SBP_TRACKING_STATE_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_TRACKING_STATE_MSGTYPE = 0x0013
staticprivate

Definition at line 79 of file AP_GPS_SBP2.h.

◆ SBP_VEL_ECEF_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_VEL_ECEF_MSGTYPE = 0x020D
staticprivate

Definition at line 77 of file AP_GPS_SBP2.h.

◆ SBP_VEL_NED_MSGTYPE

const uint16_t AP_GPS_SBP2::SBP_VEL_NED_MSGTYPE = 0x020E
staticprivate

Definition at line 78 of file AP_GPS_SBP2.h.

Referenced by _sbp_process_message().


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