Skip to content

Commit 52fca37

Browse files
committed
Add support for module unique ID
1 parent ef6f499 commit 52fca37

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,12 @@ void beginGNSS()
769769
printZEDInfo(); // Print module type and firmware version
770770
}
771771

772+
UBX_SEC_UNIQID_data_t chipID;
773+
if (theGNSS.getUniqueChipId(&chipID))
774+
{
775+
snprintf(zedUniqueId, sizeof(zedUniqueId), "%s", theGNSS.getUniqueChipIdStr(&chipID));
776+
}
777+
772778
online.gnss = true;
773779
}
774780

Firmware/RTK_Surveyor/Form.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ void createSettingsString(char *newSettings)
586586
strcpy(apZedPlatform, "ZED-F9R");
587587

588588
char apZedFirmwareVersion[80];
589-
snprintf(apZedFirmwareVersion, sizeof(apZedFirmwareVersion), "%s Firmware: %s", apZedPlatform,
590-
zedFirmwareVersion);
589+
snprintf(apZedFirmwareVersion, sizeof(apZedFirmwareVersion), "%s Firmware: %s ID: %s", apZedPlatform,
590+
zedFirmwareVersion, zedUniqueId);
591591
stringRecord(newSettings, "zedFirmwareVersion", apZedFirmwareVersion);
592592
stringRecord(newSettings, "zedFirmwareVersionInt", zedFirmwareVersionInt);
593593
}

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ void recordSystemSettingsToFile(File *settingsFile)
199199

200200
settingsFile->printf("%s=%s\r\n", "zedFirmwareVersion", zedFirmwareVersion);
201201

202+
settingsFile->printf("%s=%s\r\n", "zedUniqueId", zedUniqueId);
203+
202204
if (productVariant == RTK_FACET_LBAND)
203205
settingsFile->printf("%s=%s\r\n", "neoFirmwareVersion", neoFirmwareVersion);
204206

@@ -744,6 +746,9 @@ bool parseLine(char *str, Settings *settings)
744746
else if (strcmp(settingName, "zedFirmwareVersion") == 0)
745747
{
746748
} // Do nothing. Just read it to avoid 'Unknown setting' error
749+
else if (strcmp(settingName, "zedUniqueId") == 0)
750+
{
751+
} // Do nothing. Just read it to avoid 'Unknown setting' error
747752
else if (strcmp(settingName, "neoFirmwareVersion") == 0)
748753
{
749754
} // Do nothing. Just read it to avoid 'Unknown setting' error

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ char neoFirmwareVersion[20]; // Output to system status menu.
252252
uint8_t zedFirmwareVersionInt = 0; // Controls which features (constellations) can be configured (v1.12 doesn't support
253253
// SBAS). Note: will fail above 2.55!
254254
uint8_t zedModuleType = PLATFORM_F9P; // Controls which messages are supported and configured
255+
char zedUniqueId[11] = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0 }; // Output to system status menu and log file.
255256

256257
// Use Michael's lock/unlock methods to prevent the UART2 task from calling checkUblox during a sendCommand and
257258
// waitForResponse. Also prevents pushRawData from being called too.

Firmware/RTK_Surveyor/menuMessages.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,11 @@ void beginLogging(const char *customFileName)
615615
zedFirmwareVersion); // textID, buffer, sizeOfBuffer, text
616616
ubxFile->println(nmeaMessage);
617617

618+
// ZED-F9 unique chip ID
619+
createNMEASentence(CUSTOM_NMEA_TYPE_ZED_UNIQUE_ID, nmeaMessage, sizeof(nmeaMessage),
620+
zedUniqueId); // textID, buffer, sizeOfBuffer, text
621+
ubxFile->println(nmeaMessage);
622+
618623
// Device BT MAC. See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/346
619624
char macAddress[5];
620625
snprintf(macAddress, sizeof(macAddress), "%02X%02X", btMACAddress[4], btMACAddress[5]);

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ void menuSystem()
1717

1818
printZEDInfo();
1919

20+
systemPrintf("Module unique chip ID: %s\r\n", zedUniqueId);
21+
2022
printCurrentConditions();
2123
}
2224
else

Firmware/RTK_Surveyor/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ typedef enum
134134
CUSTOM_NMEA_TYPE_PARSER_STATS,
135135
CUSTOM_NMEA_TYPE_CURRENT_DATE,
136136
CUSTOM_NMEA_TYPE_ARP_ECEF_XYZH,
137+
CUSTOM_NMEA_TYPE_ZED_UNIQUE_ID,
137138
} customNmeaType_e;
138139

139140
// Freeze and blink LEDs if we hit a bad error

0 commit comments

Comments
 (0)