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

#include <AP_GPS_SBF.h>

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

Classes

struct  msg4001
 
struct  msg4007
 
struct  msg4014
 
struct  msg5908
 
union  msgbuffer
 
struct  sbf_msg_parser_t
 

Public Member Functions

 AP_GPS_SBF (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
AP_GPS::GPS_Status highest_supported_status (void)
 
bool read ()
 
const char * name () const override
 
bool is_configured (void) override
 
void broadcast_configuration_failure_reason (void) const override
 
bool get_lag (float &lag_sec) const override
 
bool is_healthy (void) const override
 
bool prepare_for_arming (void) 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 void inject_data (const uint8_t *data, uint16_t len)
 
virtual bool supports_mavlink_gps_rtk_message ()
 
virtual void send_mavlink_gps_rtk (mavlink_channel_t chan)
 
virtual void handle_msg (const mavlink_message_t *msg)
 
virtual void handle_gnss_msg (const AP_GPS::GPS_State &msg)
 
void broadcast_gps_type () const
 
virtual void Write_DataFlash_Log_Startup_messages () const
 

Private Types

enum  sbf_ids {
  DOP = 4001, PVTGeodetic = 4007, ReceiverStatus = 4014, ExtEventPVTGeodetic = 4038,
  VelCovGeodetic = 5908
}
 
enum  {
  SOFTWARE = (1 << 3), WATCHDOG = (1 << 4), CONGESTION = (1 << 6), MISSEDEVENT = (1 << 8),
  CPUOVERLOAD = (1 << 9), INVALIDCONFIG = (1 << 10), OUTOFGEOFENCE = (1 << 11)
}
 

Private Member Functions

bool parse (uint8_t temp)
 
bool process_message ()
 
void mount_disk (void) const
 
void unmount_disk (void) const
 
void log_ExtEventPVTGeodetic (const msg4007 &temp)
 

Private Attributes

uint8_t _init_blob_index = 0
 
uint32_t _init_blob_time = 0
 
const char * _initialisation_blob [5]
 
uint32_t _config_last_ack_time
 
const char * _port_enable = "\nSSSSSSSSSS\n"
 
uint32_t crc_error_counter = 0
 
uint32_t RxState
 
uint32_t RxError
 
bool _has_been_armed
 
struct AP_GPS_SBF::sbf_msg_parser_t sbf_msg
 

Static Private Attributes

static const uint8_t SBF_PREAMBLE1 = '$'
 
static const uint8_t SBF_PREAMBLE2 = '@'
 

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 30 of file AP_GPS_SBF.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
SOFTWARE 
WATCHDOG 
CONGESTION 
MISSEDEVENT 
CPUOVERLOAD 
INVALIDCONFIG 
OUTOFGEOFENCE 

Definition at line 201 of file AP_GPS_SBF.h.

◆ sbf_ids

enum AP_GPS_SBF::sbf_ids
private
Enumerator
DOP 
PVTGeodetic 
ReceiverStatus 
ExtEventPVTGeodetic 
VelCovGeodetic 

Definition at line 82 of file AP_GPS_SBF.h.

Constructor & Destructor Documentation

◆ AP_GPS_SBF()

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

Definition at line 53 of file AP_GPS_SBF.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ broadcast_configuration_failure_reason()

void AP_GPS_SBF::broadcast_configuration_failure_reason ( void  ) const
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 399 of file AP_GPS_SBF.cpp.

Referenced by name().

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

◆ get_lag()

bool AP_GPS_SBF::get_lag ( float &  lag_sec) const
inlineoverridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 47 of file AP_GPS_SBF.h.

Here is the call graph for this function:

◆ highest_supported_status()

AP_GPS::GPS_Status AP_GPS_SBF::highest_supported_status ( void  )
inlinevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 35 of file AP_GPS_SBF.h.

Here is the call graph for this function:

◆ is_configured()

bool AP_GPS_SBF::is_configured ( void  )
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 408 of file AP_GPS_SBF.cpp.

Referenced by name().

Here is the caller graph for this function:

◆ is_healthy()

bool AP_GPS_SBF::is_healthy ( void  ) const
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 413 of file AP_GPS_SBF.cpp.

Referenced by get_lag().

Here is the caller graph for this function:

◆ log_ExtEventPVTGeodetic()

void AP_GPS_SBF::log_ExtEventPVTGeodetic ( const msg4007 temp)
private

Definition at line 238 of file AP_GPS_SBF.cpp.

Referenced by process_message().

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

◆ mount_disk()

void AP_GPS_SBF::mount_disk ( void  ) const
private

Definition at line 417 of file AP_GPS_SBF.cpp.

Referenced by prepare_for_arming().

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

◆ name()

const char* AP_GPS_SBF::name ( ) const
inlineoverridevirtual

Implements AP_GPS_Backend.

Definition at line 40 of file AP_GPS_SBF.h.

Here is the call graph for this function:

◆ parse()

bool AP_GPS_SBF::parse ( uint8_t  temp)
private

Definition at line 111 of file AP_GPS_SBF.cpp.

Referenced by get_lag(), and read().

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

◆ prepare_for_arming()

bool AP_GPS_SBF::prepare_for_arming ( void  )
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 429 of file AP_GPS_SBF.cpp.

Referenced by get_lag().

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

◆ process_message()

bool AP_GPS_SBF::process_message ( void  )
private

Definition at line 267 of file AP_GPS_SBF.cpp.

Referenced by get_lag(), and parse().

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

◆ read()

bool AP_GPS_SBF::read ( void  )
virtual

Implements AP_GPS_Backend.

Definition at line 66 of file AP_GPS_SBF.cpp.

Referenced by highest_supported_status().

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

◆ unmount_disk()

void AP_GPS_SBF::unmount_disk ( void  ) const
private

Definition at line 423 of file AP_GPS_SBF.cpp.

Referenced by read().

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

Member Data Documentation

◆ _config_last_ack_time

uint32_t AP_GPS_SBF::_config_last_ack_time
private

Definition at line 70 of file AP_GPS_SBF.h.

Referenced by AP_GPS_SBF(), parse(), and read().

◆ _has_been_armed

bool AP_GPS_SBF::_has_been_armed
private

Definition at line 80 of file AP_GPS_SBF.h.

Referenced by prepare_for_arming(), and read().

◆ _init_blob_index

uint8_t AP_GPS_SBF::_init_blob_index = 0
private

Definition at line 62 of file AP_GPS_SBF.h.

Referenced by broadcast_configuration_failure_reason(), is_configured(), parse(), and read().

◆ _init_blob_time

uint32_t AP_GPS_SBF::_init_blob_time = 0
private

Definition at line 63 of file AP_GPS_SBF.h.

Referenced by read().

◆ _initialisation_blob

const char* AP_GPS_SBF::_initialisation_blob[5]
private
Initial value:
= {
"sso, Stream1, COM1, PVTGeodetic+DOP+ExtEventPVTGeodetic+ReceiverStatus+VelCovGeodetic, msec100\n",
"srd, Moderate, UAV\n",
"sem, PVT, 5\n",
"spm, Rover, all\n",
"sso, Stream2, Dsk1, postprocess+event+comment, msec100\n"}

Definition at line 64 of file AP_GPS_SBF.h.

Referenced by broadcast_configuration_failure_reason(), is_configured(), parse(), and read().

◆ _port_enable

const char* AP_GPS_SBF::_port_enable = "\nSSSSSSSSSS\n"
private

Definition at line 72 of file AP_GPS_SBF.h.

Referenced by AP_GPS_SBF(), and read().

◆ crc_error_counter

uint32_t AP_GPS_SBF::crc_error_counter = 0
private

Definition at line 74 of file AP_GPS_SBF.h.

Referenced by parse().

◆ RxError

uint32_t AP_GPS_SBF::RxError
private

Definition at line 76 of file AP_GPS_SBF.h.

Referenced by is_healthy(), and process_message().

◆ RxState

uint32_t AP_GPS_SBF::RxState
private

Definition at line 75 of file AP_GPS_SBF.h.

Referenced by prepare_for_arming(), process_message(), and read().

◆ sbf_msg

struct AP_GPS_SBF::sbf_msg_parser_t AP_GPS_SBF::sbf_msg
private

Referenced by AP_GPS_SBF(), parse(), and process_message().

◆ SBF_PREAMBLE1

const uint8_t AP_GPS_SBF::SBF_PREAMBLE1 = '$'
staticprivate

Definition at line 59 of file AP_GPS_SBF.h.

Referenced by parse().

◆ SBF_PREAMBLE2

const uint8_t AP_GPS_SBF::SBF_PREAMBLE2 = '@'
staticprivate

Definition at line 60 of file AP_GPS_SBF.h.

Referenced by parse().


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