Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of gnss by
Diff: gnss_operations.cpp
- Revision:
- 19:bc678f383db1
- Parent:
- 18:119e7c15ff97
- Child:
- 20:f91c0334d017
--- 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) *