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

Files at this revision

API Documentation at this revision

Comitter:
fahim.alavi@u-blox.com
Date:
Mon Dec 17 12:11:07 2018 +0500
Parent:
28:8852ebda4e8f
Child:
30:de9fcdbc4d06
Commit message:
Decoding and decoding status of NAV-SAT added

Changed in this revision

gnss.cpp Show annotated file Show diff for this revision Revisions of this file
gnss.h Show annotated file Show diff for this revision Revisions of this file
--- 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};
 
--- a/gnss.h	Wed Dec 12 18:42:54 2018 +0500
+++ b/gnss.h	Mon Dec 17 12:11:07 2018 +0500
@@ -50,7 +50,7 @@
 
 enum eUBX_MSG_CLASS {NAV = 0x01, ACK = 0x05, LOG = 0x21};
 
-enum eUBX_MESSAGE  {UBX_LOG_BATCH, UBX_ACK_ACK, UBX_ACK_NAK, UBX_NAV_ODO, UBX_NAV_PVT, NAV_STATUS, UNKNOWN_UBX};
+enum eUBX_MESSAGE  {UBX_LOG_BATCH, UBX_ACK_ACK, UBX_ACK_NAK, UBX_NAV_ODO, UBX_NAV_PVT, UBX_NAV_STATUS, UBX_NAV_SAT, UNKNOWN_UBX};
 
 typedef struct UBX_ACK_ACK {
 	uint8_t msg_class;
@@ -110,6 +110,11 @@
 
 }tUBX_NAV_STATUS;
 
+typedef struct UBX_NAV_SAT{
+	bool status;
+
+}tUBX_NAV_SAT;
+
 /** Basic GNSS parser class.
 */
 class GnssParser
@@ -272,6 +277,12 @@
 	 */
     tUBX_NAV_STATUS decode_ubx_nav_status_msg(char *);
 
+    /** Method to parse contents of UBX_NAV_SAT and return decoded msg
+	 * @param buff the UXB message, int length
+	 * @return tUBX_NAV_SAT
+	 */
+    tUBX_NAV_SAT decode_ubx_nav_sat_msg(char *, int);
+
     /** Method to send UBX LOG-RETRIEVEBATCH msg. This message is used to request batched data.
 	 * @param bool
 	 * @return int