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:
Tue Oct 16 16:09:41 2018 +0500
Parent:
21:f91c0334d017
Child:
23:c462bbec7d00
Child:
25:f538f1dc4121
Commit message:
UBX NAV-SAT and NAV-SOL enabled

Changed in this revision

gnss.cpp Show annotated file Show diff for this revision Revisions of this file
gnss_operations.cpp Show annotated file Show diff for this revision Revisions of this file
gnss_operations.h Show annotated file Show diff for this revision Revisions of this file
--- a/gnss.cpp	Mon Oct 08 14:22:33 2018 +0500
+++ b/gnss.cpp	Tue Oct 16 16:09:41 2018 +0500
@@ -292,7 +292,7 @@
 
 int GnssParser::enable_ubx() {
 
-	unsigned char ubx_cfg_prt[]={0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,0x00, 0x00};
+	unsigned char ubx_cfg_prt[]={0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,0x00, 0x00};
 	int conf = RETRY;
 	int length = 0;
 
@@ -625,7 +625,7 @@
 
     wait_ms(1000);
 
-    baud(115200);
+    baud(230400);
 
     // Send a byte to wakup the device again
 	putc(0xFF);
--- a/gnss_operations.cpp	Mon Oct 08 14:22:33 2018 +0500
+++ b/gnss_operations.cpp	Tue Oct 16 16:09:41 2018 +0500
@@ -74,6 +74,61 @@
 
 }
 
+int GnssOperations::enable_ubx_nav_sat() {
+	int conf = RETRY;
+	unsigned char enable_ubx_nav_status[]={0x01, 0x35, 0x0A};
+	conf = RETRY;
+	int length =0;
+
+	while(conf)
+	{
+
+		length = GnssSerial::sendUbx(0x06, 0x01, enable_ubx_nav_status, sizeof(enable_ubx_nav_status));
+		if(length >= (int)(sizeof(enable_ubx_nav_status) + UBX_FRAME_SIZE))
+		{
+			SEND_LOGGING_MESSAGE("UBX-NAV-STATUS was enabled\r\n");
+			wait(1);
+			break;
+		}
+		else
+		{
+			SEND_LOGGING_MESSAGE("enabling UBX-NAV-STATUS...\r\n");
+			conf = conf - 1;
+		}
+	}
+
+	return (conf == 0) ? 0 : 1;
+
+}
+
+int GnssOperations::enable_ubx_nav_sol() {
+	int conf = RETRY;
+	unsigned char enable_ubx_nav_status[]={0x01, 0x06, 0x0A};
+	conf = RETRY;
+	int length =0;
+
+	while(conf)
+	{
+
+		length = GnssSerial::sendUbx(0x06, 0x01, enable_ubx_nav_status, sizeof(enable_ubx_nav_status));
+		if(length >= (int)(sizeof(enable_ubx_nav_status) + UBX_FRAME_SIZE))
+		{
+			SEND_LOGGING_MESSAGE("UBX-NAV-STATUS was enabled\r\n");
+			wait(1);
+			break;
+		}
+		else
+		{
+			SEND_LOGGING_MESSAGE("enabling UBX-NAV-STATUS...\r\n");
+			conf = conf - 1;
+		}
+	}
+
+	return (conf == 0) ? 0 : 1;
+
+}
+
+
 /**
  *
  * Disable UBX-NAV-PVT
--- a/gnss_operations.h	Mon Oct 08 14:22:33 2018 +0500
+++ b/gnss_operations.h	Tue Oct 16 16:09:41 2018 +0500
@@ -50,6 +50,8 @@
 
 	int enable_ubx_nav_pvt();
 	int enable_ubx_nav_status();
+	int enable_ubx_nav_sat();
+	int enable_ubx_nav_sol();
 	int disable_ubx_nav_pvt();
 	int enable_ubx_nav5(unsigned int acc);
 	int enable_ubx_odo();