positioning updates
Fork of gnss by
Revision 30:9a1ce433f062, committed 2019-04-03
- Comitter:
- fahim.alavi@u-blox.com
- Date:
- Wed Apr 03 16:32:30 2019 +0500
- Parent:
- 29:de9fcdbc4d06
- Commit message:
- NAVX5 support 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 Wed Apr 03 11:53:35 2019 +0500 +++ b/gnss_operations.cpp Wed Apr 03 16:32:30 2019 +0500 @@ -192,6 +192,35 @@ return (conf == 0) ? 0 : 1; } +int GnssOperations::enable_ubx_navx5() +{ + int conf = RETRY; + conf = RETRY; + int length =0; + //convert unsigned int acc to hex + //ask if positioning mask or time accuracy mask + unsigned char ubx_cfg_navx5[]={0x28, 0x00, 0x02, 0x00, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x03, 0x02, 0x03, 0x20, 0x06, 0x00, 0x01, 0x01, 0x00, 0x00, 0x90, + 0x07, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x02, 0x64, 0x64, 0x00, 0x00, 0x01, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xF7}; + + while(conf) + { + length = GnssSerial::sendUbx(0x06, 0x23, ubx_cfg_navx5, sizeof(ubx_cfg_navx5)); + if(length >= (int)(sizeof(ubx_cfg_navx5) + UBX_FRAME_SIZE)) + { + SEND_LOGGING_MESSAGE("ubx_cfg_navx5 was enabled\r\n"); + wait(1); + break; + } + else + { + SEND_LOGGING_MESSAGE("enabling ubx_cfg_navx5...\r\n"); + conf = conf - 1; + } + } + + return (conf == 0) ? 0 : 1; +} + /** * Enabling UBX-ODOMETER using UBX-CFG-ODO * @param return SUCCESS: 1 @@ -514,6 +543,7 @@ 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}; + unsigned char CFG_NAVX5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x00, 0x29, 0x81}; this->_send(CFG_PMS, sizeof(CFG_PMS)); wait(1); @@ -527,6 +557,9 @@ this->_send(CFG_NAV5, sizeof(CFG_NAV5)); wait(1); + this->_send(CFG_NAVX5, sizeof(CFG_NAVX5)); + wait(1); + return true; }
--- a/gnss_operations.h Wed Apr 03 11:53:35 2019 +0500 +++ b/gnss_operations.h Wed Apr 03 16:32:30 2019 +0500 @@ -95,6 +95,13 @@ */ int enable_ubx_nav5(unsigned int acc); + /** Enable GNSS receiver UBX-NAVX5 messages + * Navigation Engine Settings + * @return int 1: Successful + * 0: Failure + */ + int enable_ubx_navx5(); + /** Enable GNSS receiver UBX-CFG-ODO messages * Odometer, Low-speed COG Engine Settings * @param void