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:
- 29:54fd002f2376
- Parent:
- 27:405a5e611635
- Child:
- 30:de9fcdbc4d06
--- a/gnss.cpp Wed Dec 12 18:42:54 2018 +0500 +++ b/gnss.cpp Mon Dec 17 12:11:07 2018 +0500 @@ -331,7 +331,11 @@ } break; case 0x03: { - return_value = NAV_STATUS; + return_value = UBX_NAV_STATUS; + } + break; + case 0x35: { + return_value = UBX_NAV_SAT; } break; default: @@ -554,6 +558,22 @@ return return_decoded_msg; } + +tUBX_NAV_SAT GnssParser::decode_ubx_nav_sat_msg(char *buf, int length) { + tUBX_NAV_SAT return_decoded_msg; + uint8_t index = UBX_PAYLOAD_INDEX; + uint8_t numberSVs = buf[index + 5]; + + if(length == (UBX_FRAME_SIZE + 8 + (12*numberSVs))) { + return_decoded_msg.status = true; + } + else { + return_decoded_msg.status = false; + } + + return return_decoded_msg; +} + int GnssParser::ubx_request_batched_data(bool sendMonFirst) { unsigned char ubx_log_retrieve_batch[]={0x00, 0x00, 0x00, 0x00};