fahim alavi / gnss

Dependents:   example-gnss

Fork of gnss by u-blox

Revision:
14:105cf3ca48c9
Parent:
12:10108cd3ad23
Child:
15:cb9861f0f4d8
--- 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());
 }