From 6aa62dac869c15e23cc6303992052121d2098386 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 Apr 2024 20:55:21 +0000 Subject: [PATCH 1/3] Update form.h via Python --- Firmware/RTK_Everywhere/form.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/RTK_Everywhere/form.h b/Firmware/RTK_Everywhere/form.h index aba3055a9..cec3bde0e 100644 --- a/Firmware/RTK_Everywhere/form.h +++ b/Firmware/RTK_Everywhere/form.h @@ -26,7 +26,7 @@ // python main_js_zipper.py static const uint8_t main_js[] PROGMEM = { - 0x1F, 0x8B, 0x08, 0x08, 0x73, 0x0C, 0x0F, 0x66, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A, + 0x1F, 0x8B, 0x08, 0x08, 0xB9, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A, 0x73, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0xEB, 0x7A, 0xDB, 0x38, 0xB2, 0xE0, 0xFF, 0x3C, 0x05, 0x46, 0xDB, 0x3B, 0x92, 0x26, 0xB2, 0x4C, 0xC9, 0x97, 0x5C, 0x1C, 0xE7, 0xAC, 0x6F, 0x49, 0xBC, 0x13, 0x3B, 0xFE, 0x2C, 0xA7, 0xBB, 0x93, 0x4C, 0xD6, 0x87, 0x16, 0x61, 0x99, 0x13, @@ -808,7 +808,7 @@ static const uint8_t main_js[] PROGMEM = { // python index_html_zipper.py static const uint8_t index_html[] PROGMEM = { - 0x1F, 0x8B, 0x08, 0x08, 0x73, 0x0C, 0x0F, 0x66, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E, + 0x1F, 0x8B, 0x08, 0x08, 0xB9, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0xDB, 0x72, 0xDB, 0xC8, 0x92, 0xE0, 0xBB, 0xBF, 0xA2, 0x86, 0xB3, 0xB3, 0x96, 0xE6, 0x88, 0x14, 0x49, 0x5D, 0x2C, 0xEB, 0xD8, 0x8C, 0x90, 0x44, 0xC9, 0x56, 0x1C, 0x59, 0xE6, 0x8A, 0xF2, 0xE9, 0x6E, 0x6F, 0xEC, 0x76, From c933e2337539e7157368982ef9c87c1ce52bbff8 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Fri, 5 Apr 2024 08:28:07 -0600 Subject: [PATCH 2/3] Add product variant ID to hardware ID --- Firmware/RTK_Everywhere/Display.ino | 13 ++++++----- Firmware/RTK_Everywhere/menuCommands.ino | 6 ++--- Firmware/RTK_Everywhere/menuPP.ino | 28 ++++++++++++------------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Firmware/RTK_Everywhere/Display.ino b/Firmware/RTK_Everywhere/Display.ino index 88b81f7a0..439d03106 100644 --- a/Firmware/RTK_Everywhere/Display.ino +++ b/Firmware/RTK_Everywhere/Display.ino @@ -2820,16 +2820,13 @@ void paintKeyProvisionFail(uint16_t displayTime) int y = 0; int fontHeight = 8; - printTextCenter("ZTP", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted - - y += fontHeight; printTextCenter("Failed", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted y += fontHeight; - printTextCenter("ID:", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted + printTextCenter("ZTP ID:", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted - // The MAC address is 12 characters long so we have to split it onto two lines - char hardwareID[13]; + // The device ID is 14 characters long so we have to split it into three lines + char hardwareID[15]; const uint8_t *rtkMacAddress = getMacAddress(); snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X", rtkMacAddress[0], rtkMacAddress[1], rtkMacAddress[2]); @@ -2840,6 +2837,10 @@ void paintKeyProvisionFail(uint16_t displayTime) y += fontHeight; printTextCenter(hardwareID, y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted + snprintf(hardwareID, sizeof(hardwareID), "%02X", productVariant); + y += fontHeight; + printTextCenter(hardwareID, y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted + oled->display(); delay(displayTime); diff --git a/Firmware/RTK_Everywhere/menuCommands.ino b/Firmware/RTK_Everywhere/menuCommands.ino index 79e83d088..333cf0688 100644 --- a/Firmware/RTK_Everywhere/menuCommands.ino +++ b/Firmware/RTK_Everywhere/menuCommands.ino @@ -1479,9 +1479,9 @@ void createSettingsString(char *newSettings) stringRecord(newSettings, "sdMounted", online.microSD); // Add Device ID used for corrections - char hardwareID[13]; - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], - btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]); + char hardwareID[15]; + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], + btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant); stringRecord(newSettings, "hardwareID", hardwareID); // Add Days Remaining for corrections diff --git a/Firmware/RTK_Everywhere/menuPP.ino b/Firmware/RTK_Everywhere/menuPP.ino index 94b3bf1f8..7407d05c8 100644 --- a/Firmware/RTK_Everywhere/menuPP.ino +++ b/Firmware/RTK_Everywhere/menuPP.ino @@ -219,15 +219,15 @@ bool pointperfectProvisionDevice() do { - char hardwareID[13]; - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], + char hardwareID[15]; + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], btMACAddress[2], btMACAddress[3], btMACAddress[4], - btMACAddress[5]); // Get ready for JSON + btMACAddress[5], productVariant); // Get ready for JSON #ifdef WHITELISTED_ID // Override ID with testing ID - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", whitelistID[0], whitelistID[1], - whitelistID[2], whitelistID[3], whitelistID[4], whitelistID[5]); + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", whitelistID[0], whitelistID[1], + whitelistID[2], whitelistID[3], whitelistID[4], whitelistID[5], productVariant); #endif // WHITELISTED_ID // Given name must be between 1 and 50 characters @@ -308,9 +308,9 @@ bool pointperfectProvisionDevice() } else if (ztpResponse == ZTP_DEACTIVATED && attemptNumber == 1) { - char hardwareID[13]; - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], - btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]); + char hardwareID[15]; + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], + btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant); systemPrintf("This device has been deactivated. Please contact " "support@sparkfun.com to renew the PointPerfect " @@ -321,9 +321,9 @@ bool pointperfectProvisionDevice() } else if (ztpResponse == ZTP_NOT_WHITELISTED && attemptNumber == 1) { - char hardwareID[13]; - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], - btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]); + char hardwareID[15]; + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], + btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant); systemPrintf( "This device is not whitelisted. Please contact " @@ -1421,9 +1421,9 @@ void menuPointPerfect() } else if (incoming == 4 && pointPerfectIsEnabled()) { - char hardwareID[13]; - snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], - btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]); + char hardwareID[15]; + snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1], + btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant); systemPrintf("Device ID: %s\r\n", hardwareID); } else if (incoming == 'c' && pointPerfectIsEnabled()) From 68c7b8a80f07c06e4fd389c61f0d29e8c9a288b1 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Fri, 5 Apr 2024 09:06:12 -0600 Subject: [PATCH 3/3] Add whitelist comment --- Firmware/RTK_Everywhere/settings.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/RTK_Everywhere/settings.h b/Firmware/RTK_Everywhere/settings.h index e0147a49b..b813fd090 100644 --- a/Firmware/RTK_Everywhere/settings.h +++ b/Firmware/RTK_Everywhere/settings.h @@ -70,6 +70,7 @@ typedef uint8_t RtkMode_t; #define EQ_RTK_MODE(mode) (rtkMode && (rtkMode == (mode & rtkMode))) #define NEQ_RTK_MODE(mode) (rtkMode && (rtkMode != (mode & rtkMode))) +//Used as part of device ID and whitelists. Do not reorder. typedef enum { RTK_EVK = 0,