PX4 Firmware
PX4 Autopilot Software http://px4.io
gps_helper.h File Reference
#include <cstdint>
#include "../../definitions.h"
Include dependency graph for gps_helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SurveyInStatus
 
class  GPSHelper
 

Macros

#define GPS_READ_BUFFER_SIZE   150
 buffer size for the read() call. Messages can be longer than that. More...
 
#define GPS_EPOCH_SECS   ((time_t)1234567890ULL)
 

Typedefs

typedef int(* GPSCallbackPtr) (GPSCallbackType type, void *data1, int data2, void *user)
 Callback function for platform-specific stuff. More...
 

Enumerations

enum  GPSCallbackType {
  GPSCallbackType::readDeviceData = 0, GPSCallbackType::writeDeviceData, GPSCallbackType::setBaudrate, GPSCallbackType::gotRTCMMessage,
  GPSCallbackType::surveyInStatus, GPSCallbackType::setClock
}
 
enum  GPSRestartType { GPSRestartType::None, GPSRestartType::Hot, GPSRestartType::Warm, GPSRestartType::Cold }
 

Detailed Description

Macro Definition Documentation

◆ GPS_EPOCH_SECS

#define GPS_EPOCH_SECS   ((time_t)1234567890ULL)

◆ GPS_READ_BUFFER_SIZE

#define GPS_READ_BUFFER_SIZE   150

Typedef Documentation

◆ GPSCallbackPtr

typedef int(* GPSCallbackPtr) (GPSCallbackType type, void *data1, int data2, void *user)

Callback function for platform-specific stuff.

data1 and data2 depend on type and user is the custom user-supplied argument.

Returns
<0 on error, >=0 on success (depending on type)

Definition at line 132 of file gps_helper.h.

Enumeration Type Documentation

◆ GPSCallbackType

enum GPSCallbackType
strong
Enumerator
readDeviceData 

Read data from device.

This is a blocking operation with a timeout. data1: points to a buffer to be written to. The first sizeof(int) bytes contain the timeout in ms when calling the method. data2: buffer length in bytes. Less bytes than this can be read. return: num read bytes, 0 on timeout (the method can actually also return 0 before the timeout happens).

writeDeviceData 

Write data to device data1: data to be written data2: number of bytes to write return: num written bytes.

setBaudrate 

set Baudrate data1: ignored data2: baudrate return: 0 on success

gotRTCMMessage 

Got an RTCM message from the device.

data1: pointer to the message data2: message length return: ignored

surveyInStatus 

message about current survey-in status data1: points to a SurveyInStatus struct data2: ignored return: ignored

setClock 

can be used to set the current clock accurately data1: pointer to a timespec struct data2: ignored return: ignored

Definition at line 49 of file gps_helper.h.

◆ GPSRestartType

enum GPSRestartType
strong
Enumerator
None 
Hot 

In hot start mode, the receiver was powered down only for a short time (4 hours or less), so that its ephemeris is still valid.

Since the receiver doesn't need to download ephemeris again, this is the fastest startup method.

Warm 

In warm start mode, the receiver has approximate information for time, position, and coarse satellite position data (Almanac).

In this mode, after power-up, the receiver normally needs to download ephemeris before it can calculate position and velocity data.

Cold 

In cold start mode, the receiver has no information from the last position at startup.

Therefore, the receiver must search the full time and frequency space, and all possible satellite numbers. If a satellite signal is found, it is tracked to decode the ephemeris, whereas the other channels continue to search satellites. Once there is a sufficient number of satellites with valid ephemeris, the receiver can calculate position and velocity data.

Definition at line 101 of file gps_helper.h.