|
30 | 30 | 05 00 04 00 01 00 11 11 |
31 | 31 | 06 08 0C 00 00 00 11 11 |
32 | 32 | 00 00 00 00 00 00 00 00 |
33 | | -Above, on ZED-F9P v1.12, BeiDou is disabled. Why is SBAS not being reported? |
34 | | -Ah, it's a v1.12 bug. Works fine in v1.13 and on ZED-F9R v1.0 |
| 33 | + Above, on ZED-F9P v1.12, BeiDou is disabled. Why is SBAS not being reported? |
| 34 | + Ah, it's a v1.12 bug. Works fine in v1.13 and on ZED-F9R v1.0 |
35 | 35 |
|
36 | 36 | Ugh. The issue is that the doc says IMES is gnssid 4 but really QZSS is in 4th position but with ID 5. |
37 | 37 |
|
@@ -63,7 +63,7 @@ void setup() |
63 | 63 |
|
64 | 64 | Wire.begin(); |
65 | 65 | Wire.setClock(400000); |
66 | | - |
| 66 | + |
67 | 67 | //i2cGNSS.enableDebugging(); // Uncomment this line to enable debug messages |
68 | 68 |
|
69 | 69 | if (i2cGNSS.begin() == false) //Connect to the Ublox module using Wire port |
@@ -164,10 +164,41 @@ void loop() |
164 | 164 | else |
165 | 165 | Serial.println("Disable QZSS Success"); |
166 | 166 | } |
| 167 | + else if(incoming == '!') |
| 168 | + { |
| 169 | + for(int x = 0 ; x < 6 ; x++) |
| 170 | + { |
| 171 | + bool isEnabled = false; |
| 172 | + if(x == 0) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_GPS); |
| 173 | + else if(x == 1) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_SBAS); |
| 174 | + else if(x == 2) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_GALILEO); |
| 175 | + else if(x == 3) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_BEIDOU); |
| 176 | + else if(x == 4) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_QZSS); |
| 177 | + else if(x == 5) isEnabled = getConstellation(SFE_UBLOX_GNSS_ID_GLONASS); |
| 178 | + |
| 179 | + Serial.print("Module reports "); |
| 180 | + if(x == 0) Serial.print("GPS"); |
| 181 | + else if(x == 1) Serial.print("SBAS"); |
| 182 | + else if(x == 2) Serial.print("GALILEO"); |
| 183 | + else if(x == 3) Serial.print("BeiDou"); |
| 184 | + else if(x == 4) Serial.print("QZSS"); |
| 185 | + else if(x == 5) Serial.print("GLONASS"); |
| 186 | + Serial.print(": "); |
| 187 | + if (isEnabled == true) |
| 188 | + Serial.println("Enabled"); |
| 189 | + else |
| 190 | + Serial.println("Disabled"); |
| 191 | + } |
| 192 | + } |
| 193 | + else if(incoming == '\n' || incoming == '\r') |
| 194 | + { |
| 195 | + //Do nothing |
| 196 | + } |
167 | 197 | else |
168 | 198 | { |
169 | 199 | //Serial.println("Unknown"); |
170 | 200 | } |
| 201 | + |
171 | 202 | } |
172 | 203 |
|
173 | 204 | } |
@@ -293,3 +324,27 @@ uint8_t locateGNSSID(uint8_t *customPayload, uint8_t constellation) |
293 | 324 | Serial.println(F("locateGNSSID failed")); |
294 | 325 | return (0); |
295 | 326 | } |
| 327 | + |
| 328 | +//Returns true if constellation is enabled |
| 329 | +bool getConstellation(uint8_t constellationID) |
| 330 | +{ |
| 331 | + uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes |
| 332 | + ubxPacket customCfg = {0, 0, 0, 0, 0, customPayload, 0, 0, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED}; |
| 333 | + |
| 334 | + customCfg.cls = UBX_CLASS_CFG; // This is the message Class |
| 335 | + customCfg.id = UBX_CFG_GNSS; // This is the message ID |
| 336 | + customCfg.len = 0; // Setting the len (length) to zero lets us poll the current settings |
| 337 | + customCfg.startingSpot = 0; // Always set the startingSpot to zero (unless you really know what you are doing) |
| 338 | + |
| 339 | + uint16_t maxWait = 1250; // Wait for up to 250ms (Serial may need a lot longer e.g. 1100) |
| 340 | + |
| 341 | + // Read the current setting. The results will be loaded into customCfg. |
| 342 | + if (i2cGNSS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK |
| 343 | + { |
| 344 | + Serial.println(F("Get Constellation failed")); |
| 345 | + return (false); |
| 346 | + } |
| 347 | + |
| 348 | + if (customPayload[locateGNSSID(customPayload, constellationID) + 4] & (1 << 0)) return true; //Check if bit 0 is set |
| 349 | + return false; |
| 350 | +} |
0 commit comments