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 Jul 24 16:02:21 2018 +0500
Parent:
14:4b22bd505b93
Child:
16:cb9861f0f4d8
Commit message:
Baud rate increased

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 Jun 13 16:59:19 2018 +0500
+++ b/gnss.cpp	Tue Jul 24 16:02:21 2018 +0500
@@ -286,7 +286,7 @@
 
 int GnssParser::enable_ubx() {
 
-	unsigned char ubx_cfg_prt[]={0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,0x00, 0x00};
+	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};
 	int conf = RETRY;
 	int length = 0;
 
@@ -571,6 +571,19 @@
     
     enable_ubx();
 
+    wait_ms(1000);
+
+    baud(115200);
+
+    // Send a byte to wakup the device again
+	putc(0xFF);
+	// Wait until we get some bytes
+	size = _pipeRx.size();
+	timer.start();
+	while ((timer.read_ms() < 1000) && (size == _pipeRx.size())) {
+		/* Nothing, just wait */
+	}
+
     return (size != _pipeRx.size());
 }
 
--- a/gnss.h	Wed Jun 13 16:59:19 2018 +0500
+++ b/gnss.h	Tue Jul 24 16:02:21 2018 +0500
@@ -330,6 +330,7 @@
     
     /** Initialise the GNSS device.
      * @param pn  NOT USED.
+     * @param baudrate
      * @return true if successful, otherwise false.
      */
     virtual bool init(PinName pn = NC);