This class provides an API to communicate with a u-blox GNSS chip. The files here were originally part of the C027_Support library (https://developer.mbed.org/teams/ublox/code/C027_Support/ at revision 138:dafbbf31bf76) but have been separated out, primarily for use on the u-blox C030 board where the cellular interace portion of the C027_Support library will instead be provided through the new mbed Cellular API.
Dependents: example-ublox-at-cellular-interface-ext example-low-power-sleep example-C030-out-of-box-demo example-C030-out-of-box-demo ... more
Diff: gnss.cpp
- Revision:
- 17:6c226e3e9d61
- Parent:
- 16:cb9861f0f4d8
- Child:
- 21:f91c0334d017
--- a/gnss.cpp Wed Aug 01 13:14:52 2018 +0500 +++ b/gnss.cpp Mon Sep 03 14:39:27 2018 +0500 @@ -436,6 +436,10 @@ return_decoded_msg.day = buf[index++]; + // Go to Fix type + index = UBX_PAYLOAD_INDEX + 20; + return_decoded_msg.fixType = buf[index]; + // Go to lon index = UBX_PAYLOAD_INDEX + 24; @@ -454,6 +458,13 @@ return_decoded_msg.height |= (buf[index++] << 16); return_decoded_msg.height |= (buf[index++] << 24); + // Go to gSpeed + index = UBX_PAYLOAD_INDEX + 60; + return_decoded_msg.speed = buf[index++]; + return_decoded_msg.speed |= (buf[index++] << 8); + return_decoded_msg.speed |= (buf[index++] << 16); + return_decoded_msg.speed |= (buf[index++] << 24); + return return_decoded_msg; }