u-blox / gnss

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:
Fri Oct 05 18:46:48 2018 +0500
Parent:
19:119e7c15ff97
Child:
21:f91c0334d017
Commit message:
Verify GNSS method added

Changed in this revision

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_operations.cpp	Fri Oct 05 17:28:16 2018 +0500
+++ b/gnss_operations.cpp	Fri Oct 05 18:46:48 2018 +0500
@@ -358,6 +358,7 @@
 		length = GnssSerial::sendUbx(0x06, 0x3B, semi_continuous_pm2, sizeof(semi_continuous_pm2));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, semi_continuous_rate, sizeof(semi_continuous_rate));
+		wait(1);
 		break;
 
 	case AGGRESSIVE_CONTINUOS:
@@ -367,6 +368,7 @@
 		length = GnssSerial::sendUbx(0x06, 0x3B, aggresive_continuous_pm2, sizeof(aggresive_continuous_pm2));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, aggressive_continuous_rate, sizeof(aggressive_continuous_rate));
+		wait(1);
 		break;
 
 	case CONSERVATIVE_CONTINOUS:
@@ -376,6 +378,7 @@
 		length = GnssSerial::sendUbx(0x06, 0x3B, conservative_continuous_pm2, sizeof(conservative_continuous_pm2));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, conservative_continuous_rate, sizeof(conservative_continuous_rate));
+		wait(1);
 		break;
 
 	case FULL_POWER:
@@ -383,23 +386,49 @@
 		length = GnssSerial::sendUbx(0x06, 0x86, full_power_pms, sizeof(full_power_pms));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, full_power_rate, sizeof(full_power_rate));
+		wait(1);
 		break;
 	case FULL_POWER_BLOCK_LEVEL:
 		SEND_LOGGING_MESSAGE("Configuring FULL_POWER_BLOCK_LEVEL");
 		length = GnssSerial::sendUbx(0x06, 0x86, full_power_block_level_pms, sizeof(full_power_block_level_pms));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, full_power_block_level_rate, sizeof(full_power_block_level_rate));
+		wait(1);
 		break;
 	case FULL_POWER_BUILDING_LEVEL:
 		SEND_LOGGING_MESSAGE("Configuring FULL_POWER_BUILDING_LEVEL");
 		length = GnssSerial::sendUbx(0x06, 0x86, full_power_building_level_pms, sizeof(full_power_building_level_pms));
 		wait(1);
 		length = GnssSerial::sendUbx(0x06, 0x08, full_power_building_level_rate, sizeof(full_power_building_level_rate));
+		wait(1);
 		break;
 	}
+
 	return (length >= (int)(sizeof(semi_continuous_pms) + UBX_FRAME_SIZE)) ? 1 : 0;
 }
 
+bool GnssOperations::verify_gnss_mode() {
+
+	unsigned char CFG_PMS[] = {0xB5, 0x62, 0x06, 0x86, 0x00, 0x00, 0x8c, 0xAA};
+	unsigned char CFG_PM2[] = {0xB5, 0x62, 0x06, 0x3B, 0x00, 0x00, 0x41, 0xC9};
+	unsigned char CFG_RATE[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x0E, 0x30};
+	unsigned char CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x00, 0x2A, 0x84};
+
+	this->_send(CFG_PMS, sizeof(CFG_PMS));
+	wait(1);
+
+	this->_send(CFG_PM2, sizeof(CFG_PM2));
+	wait(1);
+
+	this->_send(CFG_RATE, sizeof(CFG_RATE));
+	wait(1);
+
+	this->_send(CFG_NAV5, sizeof(CFG_NAV5));
+	wait(1);
+
+	return true;
+}
+
 /**
  *  GNSS start modes (Hot/Warm/Cold start)
  *
--- a/gnss_operations.h	Fri Oct 05 17:28:16 2018 +0500
+++ b/gnss_operations.h	Fri Oct 05 18:46:48 2018 +0500
@@ -59,6 +59,7 @@
 	int disable_ubx_batch_feature();
 	int cfg_batch_feature(tUBX_CFG_BATCH *obj);
 	int cfg_power_mode(Powermodes power_mode);
+	bool verify_gnss_mode();
 	int start_mode(int start_mode);
 
 	void send_to_gnss(char);