1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page gps_usecase1 Reading GPS data from sensor
5 The `dwSensorGPS_readFrame()` function reads the next available GPS data
6 frame with a given timeout. The function call is blocking, until a GPS
7 frame is available or the timeout is exceeded. Frames read from the sensor
8 do not have to be returned because the messages are copied.
10 Depending on the particular GPS sensor capabilities, a GPS frame can be
11 only partially filled with data. The `::dwGPSFlags` are used to indicate
12 which fields in `dwGPSFrame` are valid.
16 The following code shows the general structure of a program reading data
19 dwSensorParams params;
20 params.protocol = "gps.uart";
21 params.parameters = "device=/dev/<serial device>,baud=<baudrate>";
23 dwSensorHandle_t gpsSensor;
24 dwSAL_createSensor(&gpsSensor, params, ...);
26 dwSensor_start(gpsSensor);
31 dwSensorGPS_readFrame(&frame, 50000, gpsSensor);
35 dwSensor_stop(gpsSensor);
36 dwSAL_releaseSensor(&gpsSensor);
38 For more details see @ref dwx_gps_loc_sample