1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page gps_usecase2 Reading GPS data from raw (binary) data.
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 The `dwSensorGPS_processRawData()` and `dwSensorGPS_popFrame()` functions
8 can be used to parse raw sensor data and read the measurements in the
9 `::dwGPSFrame` format. `dwSensorGPS_processRawData()` copies parsed data,
10 therefore the raw data can be returned after the call.
14 The following code shows the general structure of a program reading raw
15 data from a sensor, serializing it and parsing it.
17 dwSensorHandle_t gpsSensor;
18 dwSAL_createSensor(&gpsSensor, ..., ...);
20 dwSensor_start(gpsSensor);
22 const uint8_t *data = nullptr;
27 dwStatus status = DW_NOT_READY;
29 while (status == DW_NOT_READY)
31 dwSensor_readRawData(&data, &size, 1000000, gpsSensor);
33 status = dwSensorGPS_processRawData(data, size, gpsSensor);
35 dwSensorSerializer_serializeDataAsync(data, size, ...);
37 dwSensor_returnRawData(data, gpsSensor);
41 dwSensorGPS_popFrame(&frame, gpsSensor);
46 dwSensor_stop(gpsSensor);
47 dwSAL_releaseSensor(&gpsSensor);
49 For more details see @ref dwx_record_sample