Skip to content

Commit

Permalink
UC6580 GNSS ident fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 15, 2024
1 parent 9f4531e commit 14407ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions software/firmware/source/SkyWatch/GNSSHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ const gnss_chip_ops_t at65_ops = {
static gnss_id_t uc65_probe()
{
/* Firmware version request */
return nmea_handshake("$PDTINFO\r\n", "$PDTINFO,FB2S UM600", false) ?
return nmea_handshake("$PDTINFO\r\n", "$PDTINFO,", false) ?
GNSS_MODULE_UC65 : GNSS_MODULE_NMEA;
}

Expand Down Expand Up @@ -1102,14 +1102,14 @@ static bool uc65_setup()

size_t len = strlen((char *) &GNSSbuf[0]);

if (len > 14) {
for (int i=14; i < len; i++) {
if (len > 9) {
for (int i=9; i < len; i++) {
if (GNSSbuf[i] == '*') {
GNSSbuf[i] = 0;
}
}
Serial.print(F("INFO: GNSS module FW version: "));
Serial.println((char *) &GNSSbuf[14]);
Serial.print(F("INFO: GNSS ident - "));
Serial.println((char *) &GNSSbuf[9]);
}

delay(250);
Expand All @@ -1122,6 +1122,7 @@ static bool uc65_setup()
*/
Serial_GNSS_Out.write("$CFGMSG,0,2,0\r\n"); delay(250); /* GSA off */
Serial_GNSS_Out.write("$CFGMSG,0,3,0\r\n"); delay(250); /* GSV off */
Serial_GNSS_Out.write("$CFGMSG,6,0,0\r\n"); delay(250); /* TXT off */

return true;
}
Expand Down
11 changes: 6 additions & 5 deletions software/firmware/source/SoftRF/src/driver/GNSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ const gnss_chip_ops_t at65_ops = {
static gnss_id_t uc65_probe()
{
/* Firmware version request */
return nmea_handshake("$PDTINFO\r\n", "$PDTINFO,FB2S UM600", false) ?
return nmea_handshake("$PDTINFO\r\n", "$PDTINFO,", false) ?
GNSS_MODULE_UC65 : GNSS_MODULE_NMEA;
}

Expand Down Expand Up @@ -1101,14 +1101,14 @@ static bool uc65_setup()

size_t len = strlen((char *) &GNSSbuf[0]);

if (len > 14) {
for (int i=14; i < len; i++) {
if (len > 9) {
for (int i=9; i < len; i++) {
if (GNSSbuf[i] == '*') {
GNSSbuf[i] = 0;
}
}
Serial.print(F("INFO: GNSS module FW version: "));
Serial.println((char *) &GNSSbuf[14]);
Serial.print(F("INFO: GNSS ident - "));
Serial.println((char *) &GNSSbuf[9]);
}

delay(250);
Expand All @@ -1121,6 +1121,7 @@ static bool uc65_setup()
*/
Serial_GNSS_Out.write("$CFGMSG,0,2,0\r\n"); delay(250); /* GSA off */
Serial_GNSS_Out.write("$CFGMSG,0,3,0\r\n"); delay(250); /* GSV off */
Serial_GNSS_Out.write("$CFGMSG,6,0,0\r\n"); delay(250); /* TXT off */

return true;
}
Expand Down

0 comments on commit 14407ac

Please sign in to comment.