Defines the GPS sensor.
Data Structures | |
struct | dwGPSFrameNew |
This structure contains one frame of data from an GPS/GNSS sensor. More... | |
Functions | |
DW_API_PUBLIC dwStatus | dwSensorGPS_popFrame (dwGPSFrame *const frame, dwSensorHandle_t const sensor) |
Returns any GPS frame previously processed through RAW data stream. More... | |
DW_API_PUBLIC dwStatus | dwSensorGPS_popFrameNew (dwGPSFrameNew *const frame, dwSensorHandle_t const sensor) |
Returns any GPS frame New previously processed through RAW data stream. More... | |
DW_API_PUBLIC dwStatus | dwSensorGPS_processRawData (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor) |
Decodes RAW data previously read. More... | |
DW_API_PUBLIC dwStatus | dwSensorGPS_processRawDataNew (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor) |
Decodes RAW data previously read. More... | |
DW_API_PUBLIC dwStatus | dwSensorGPS_readFrame (dwGPSFrame *const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor) |
Reads the next available GPS data frame with a given timeout. More... | |
DW_API_PUBLIC dwStatus | dwSensorGPS_readFrameNew (dwGPSFrameNew *const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor) |
Reads the next GPS packet with a given timeout. More... | |
struct dwGPSFrameNew |
Data Fields | ||
---|---|---|
float64_t | altitude |
|
float64_t | climb |
|
float64_t | course |
|
dwGPSFixStatus | fixStatus |
|
float64_t | hacc |
|
float64_t | hdop |
|
float64_t | latitude |
|
float64_t | longitude |
|
dwGPSMode | mode |
|
float64_t | pdop |
|
uint8_t | reserved[508] | Reserved space. |
uint8_t | satelliteCount |
|
float64_t | speed |
|
dwTime_t | timestamp_us |
|
dwGPSTimestampQuality | timestampQuality |
|
dwTime_t | utcTime |
|
float64_t | vacc |
|
dwGPSSignalValidityInfo | validityInfo | Signal validity information. |
float64_t | vdop |
|
DW_API_PUBLIC dwStatus dwSensorGPS_popFrame | ( | dwGPSFrame *const | frame, |
dwSensorHandle_t const | sensor | ||
) |
Returns any GPS frame previously processed through RAW data stream.
This happens on the CPU thread where the function is called, incurring an additional load on that thread.
This function returns only the first single decoded GPS frame from cached GPS frames(and removes it from cache). If no frames are available in queue, DW_NOT_AVAILABLE is returned and no GPS frame is returned.
This function should only be called after sensor is started. From above descriptions, this function requires previous callings to function dwSensorGPS_readFrame or dwSensorGPS_processRawData returns success otherwise this function will return DW_NOT_AVAILABLE.
This function is a synchronous function. Customers have to wait till the polling of GPS frame queue is finished.
[out] | frame | Pointer to an GPS frame structure to be filled with new data. |
[in] | sensor | Sensor handle of the sensor previously created with 'dwSAL_createSensor()'. |
DW_API_PUBLIC dwStatus dwSensorGPS_popFrameNew | ( | dwGPSFrameNew *const | frame, |
dwSensorHandle_t const | sensor | ||
) |
Returns any GPS frame New previously processed through RAW data stream.
This happens on the CPU thread where the function is called, incurring an additional load on that thread.
[out] | frame | Pointer to an GPS frame New structure to be filled with new data. |
[in] | sensor | Sensor handle of the sensor previously created with 'dwSAL_createSensor()'. |
DW_API_PUBLIC dwStatus dwSensorGPS_processRawData | ( | uint8_t const *const | data, |
size_t const | size, | ||
dwSensorHandle_t const | sensor | ||
) |
Decodes RAW data previously read.
Any processed messages can be picked up using the dwSensorGPS_popMessage() method. This happens on the CPU thread where the function is called, incurring on additional load on that thread.
This API function will achieve functionality of this software unit:
This API function will push specified GPS sensor packet into its internal GPS decoders. Since internal GPS decoder will return once an GPS frame is decoded, or no GPS frames could be decoded from remaining bytes from specified GPS sensor packet, thus this API function will keep driving the decoder to return as many GPS frames as possible, until decoder could return no new GPS frames. All decoded GPS frames are cached internally and could be accessed by dwSensorGPS_readFrame() or dwSensorGPS_popFrame(). Based on sensor configuration value 'output-timestamp=', decoded GPS frames would be modified in their hostTimestamp field values accordingly.
This function should only be called after sensor is started, and with raw GPS sensor packet(s) returned from dwSensor_readRawData. After this raw sensor packet is processed by this function, user should also call dwSensor_returnRawData to return the memory block to SAL.
This function is a synchronous function. Customers have to wait till the raw GPS sensor data is processed.
[in] | data | Undecoded gps data. |
[in] | size | Size in bytes of the raw data. |
[in] | sensor | Sensor handle of the sensor previously created with 'dwSAL_createSensor()'. |
DW_API_PUBLIC dwStatus dwSensorGPS_processRawDataNew | ( | uint8_t const *const | data, |
size_t const | size, | ||
dwSensorHandle_t const | sensor | ||
) |
Decodes RAW data previously read.
Any processed messages can be picked up using the dwSensorGPS_popMessageNew() method. This happens on the CPU thread where the function is called, incurring on additional load on that thread.
[in] | data | Undecoded gps data. |
[in] | size | Size in bytes of the raw data. |
[in] | sensor | Sensor handle of the sensor previously created with 'dwSAL_createSensor()'. |
DW_API_PUBLIC dwStatus dwSensorGPS_readFrame | ( | dwGPSFrame *const | frame, |
dwTime_t const | timeoutUs, | ||
dwSensorHandle_t const | sensor | ||
) |
Reads the next available GPS data frame with a given timeout.
The method blocks until either a new valid frame is received from the sensor or the given timeout exceeds. Frames read from the sensor do not have to be returned because the messages are copied.
This API function will achieve two functionalities of this software unit:
This API function will firstly check if there are already decoded GPS frames available, if there are decoded GPS frames then this API function returns the first decoded GPS frame then return; otherwise it will read GPS sensor packet then decode it and return first decoded GPS frames, or return DW_TIME_OUT if no GPS frames could be decoded till timeout is detected.
This function is only used after the GPS sensor is initialized and started successfully.
[out] | frame | A pointer to a GPS frame structure to be filled with new localization data. |
[in] | timeoutUs | Specify the timeout in us to wait for a new message. Special values:
|
[in] | sensor | Specify the sensor handle of the GPS sensor previously created with 'dwSAL_createSensor()'. |
DW_API_PUBLIC dwStatus dwSensorGPS_readFrameNew | ( | dwGPSFrameNew *const | frame, |
dwTime_t const | timeoutUs, | ||
dwSensorHandle_t const | sensor | ||
) |
Reads the next GPS packet with a given timeout.
The method blocks until either a new valid frame is received from the sensor or the given timeout exceeds.
[out] | frame | A pointer to a GPS frame New structure to be filled with new localization data. |
[in] | timeoutUs | Specify the timeout in us to wait for a new message. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue. |
[in] | sensor | Specify the sensor handle of the GPS sensor previously created with 'dwSAL_createSensor()'. |