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

#include <AP_GPS_MTK.h>

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

Classes

struct  diyd_mtk_msg
 
union  PACKED
 

Public Member Functions

 AP_GPS_MTK (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
bool read (void)
 
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 AP_GPS::GPS_Status highest_supported_status (void)
 
virtual bool is_configured (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 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 MTK_detect_state &state, uint8_t data)
 
static void send_init_blob (uint8_t instance, AP_GPS &gps)
 

Private Types

enum  diyd_mtk_fix_type { FIX_NONE = 1, FIX_2D = 2, FIX_3D = 3 }
 
enum  diyd_mtk_protocol_bytes { PREAMBLE1 = 0xb5, PREAMBLE2 = 0x62, MESSAGE_CLASS = 1, MESSAGE_ID = 5 }
 

Private Member Functions

void _parse_gps ()
 

Private Attributes

uint8_t _ck_a
 
uint8_t _ck_b
 
uint8_t _step
 
uint8_t _payload_counter
 
union AP_GPS_MTK::PACKED _buffer
 

Static Private Attributes

static const char _initialisation_blob [] = MTK_OUTPUT_5HZ SBAS_ON WAAS_ON MTK_NAVTHRES_OFF
 

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_MTK.h.

Member Enumeration Documentation

◆ diyd_mtk_fix_type

Enumerator
FIX_NONE 
FIX_2D 
FIX_3D 

Definition at line 52 of file AP_GPS_MTK.h.

◆ diyd_mtk_protocol_bytes

Enumerator
PREAMBLE1 
PREAMBLE2 
MESSAGE_CLASS 
MESSAGE_ID 

Definition at line 58 of file AP_GPS_MTK.h.

Constructor & Destructor Documentation

◆ AP_GPS_MTK()

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

Definition at line 30 of file AP_GPS_MTK.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _detect()

bool AP_GPS_MTK::_detect ( struct MTK_detect_state state,
uint8_t  data 
)
static

Definition at line 170 of file AP_GPS_MTK.cpp.

Referenced by AP_GPS::detect_instance().

Here is the caller graph for this function:

◆ _parse_gps()

void AP_GPS_MTK::_parse_gps ( )
private

◆ name()

const char* AP_GPS_MTK::name ( ) const
inlineoverridevirtual

Implements AP_GPS_Backend.

Definition at line 39 of file AP_GPS_MTK.h.

◆ read()

bool AP_GPS_MTK::read ( void  )
virtual

Implements AP_GPS_Backend.

Definition at line 59 of file AP_GPS_MTK.cpp.

Here is the call graph for this function:

◆ send_init_blob()

void AP_GPS_MTK::send_init_blob ( uint8_t  instance,
AP_GPS gps 
)
static

Definition at line 41 of file AP_GPS_MTK.cpp.

Referenced by AP_GPS_MTK19::AP_GPS_MTK19().

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

Member Data Documentation

◆ _buffer

union AP_GPS_MTK::PACKED AP_GPS_MTK::_buffer
private

Referenced by read().

◆ _ck_a

uint8_t AP_GPS_MTK::_ck_a
private

Definition at line 66 of file AP_GPS_MTK.h.

Referenced by read().

◆ _ck_b

uint8_t AP_GPS_MTK::_ck_b
private

Definition at line 67 of file AP_GPS_MTK.h.

Referenced by read().

◆ _initialisation_blob

const char AP_GPS_MTK::_initialisation_blob = MTK_OUTPUT_5HZ SBAS_ON WAAS_ON MTK_NAVTHRES_OFF
staticprivate

Definition at line 82 of file AP_GPS_MTK.h.

Referenced by AP_GPS_MTK(), and send_init_blob().

◆ _payload_counter

uint8_t AP_GPS_MTK::_payload_counter
private

Definition at line 71 of file AP_GPS_MTK.h.

Referenced by read().

◆ _step

uint8_t AP_GPS_MTK::_step
private

Definition at line 70 of file AP_GPS_MTK.h.

Referenced by read().


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