Skip to content

Commit 87b25a8

Browse files
authored
Merge pull request #223 from sparkfun/release_candidate
Release candidate
2 parents 0e0c946 + 7647d70 commit 87b25a8

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,16 +2820,13 @@ void paintKeyProvisionFail(uint16_t displayTime)
28202820
int y = 0;
28212821
int fontHeight = 8;
28222822

2823-
printTextCenter("ZTP", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
2824-
2825-
y += fontHeight;
28262823
printTextCenter("Failed", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
28272824

28282825
y += fontHeight;
2829-
printTextCenter("ID:", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
2826+
printTextCenter("ZTP ID:", y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
28302827

2831-
// The MAC address is 12 characters long so we have to split it onto two lines
2832-
char hardwareID[13];
2828+
// The device ID is 14 characters long so we have to split it into three lines
2829+
char hardwareID[15];
28332830
const uint8_t *rtkMacAddress = getMacAddress();
28342831

28352832
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X", rtkMacAddress[0], rtkMacAddress[1], rtkMacAddress[2]);
@@ -2840,6 +2837,10 @@ void paintKeyProvisionFail(uint16_t displayTime)
28402837
y += fontHeight;
28412838
printTextCenter(hardwareID, y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
28422839

2840+
snprintf(hardwareID, sizeof(hardwareID), "%02X", productVariant);
2841+
y += fontHeight;
2842+
printTextCenter(hardwareID, y, QW_FONT_5X7, 1, false); // text, y, font type, kerning, inverted
2843+
28432844
oled->display();
28442845

28452846
delay(displayTime);

Firmware/RTK_Everywhere/form.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// python main_js_zipper.py
2727

2828
static const uint8_t main_js[] PROGMEM = {
29-
0x1F, 0x8B, 0x08, 0x08, 0xCA, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A,
29+
0x1F, 0x8B, 0x08, 0x08, 0xB9, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A,
3030
0x73, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0xEB, 0x7A, 0xDB, 0x38, 0xB2, 0xE0, 0xFF,
3131
0x3C, 0x05, 0x46, 0xDB, 0x3B, 0x92, 0x26, 0xB2, 0x4C, 0xC9, 0x97, 0x5C, 0x1C, 0xE7, 0xAC, 0x6F,
3232
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 = {
808808
// python index_html_zipper.py
809809

810810
static const uint8_t index_html[] PROGMEM = {
811-
0x1F, 0x8B, 0x08, 0x08, 0xCA, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
811+
0x1F, 0x8B, 0x08, 0x08, 0xB9, 0x13, 0x0F, 0x66, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
812812
0x68, 0x74, 0x6D, 0x6C, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0xDB, 0x72, 0xDB, 0xC8,
813813
0x92, 0xE0, 0xBB, 0xBF, 0xA2, 0x86, 0xB3, 0xB3, 0x96, 0xE6, 0x88, 0x14, 0x49, 0x5D, 0x2C, 0xEB,
814814
0xD8, 0x8C, 0x90, 0x44, 0xC9, 0x56, 0x1C, 0x59, 0xE6, 0x8A, 0xF2, 0xE9, 0x6E, 0x6F, 0xEC, 0x76,

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,9 +1479,9 @@ void createSettingsString(char *newSettings)
14791479
stringRecord(newSettings, "sdMounted", online.microSD);
14801480

14811481
// Add Device ID used for corrections
1482-
char hardwareID[13];
1483-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
1484-
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]);
1482+
char hardwareID[15];
1483+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
1484+
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant);
14851485
stringRecord(newSettings, "hardwareID", hardwareID);
14861486

14871487
// Add Days Remaining for corrections

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ bool pointperfectProvisionDevice()
219219

220220
do
221221
{
222-
char hardwareID[13];
223-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
222+
char hardwareID[15];
223+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
224224
btMACAddress[2], btMACAddress[3], btMACAddress[4],
225-
btMACAddress[5]); // Get ready for JSON
225+
btMACAddress[5], productVariant); // Get ready for JSON
226226

227227
#ifdef WHITELISTED_ID
228228
// Override ID with testing ID
229-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", whitelistID[0], whitelistID[1],
230-
whitelistID[2], whitelistID[3], whitelistID[4], whitelistID[5]);
229+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", whitelistID[0], whitelistID[1],
230+
whitelistID[2], whitelistID[3], whitelistID[4], whitelistID[5], productVariant);
231231
#endif // WHITELISTED_ID
232232

233233
// Given name must be between 1 and 50 characters
@@ -308,9 +308,9 @@ bool pointperfectProvisionDevice()
308308
}
309309
else if (ztpResponse == ZTP_DEACTIVATED && attemptNumber == 1)
310310
{
311-
char hardwareID[13];
312-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
313-
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]);
311+
char hardwareID[15];
312+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
313+
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant);
314314

315315
systemPrintf("This device has been deactivated. Please contact "
316316
"[email protected] to renew the PointPerfect "
@@ -321,9 +321,9 @@ bool pointperfectProvisionDevice()
321321
}
322322
else if (ztpResponse == ZTP_NOT_WHITELISTED && attemptNumber == 1)
323323
{
324-
char hardwareID[13];
325-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
326-
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]);
324+
char hardwareID[15];
325+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
326+
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant);
327327

328328
systemPrintf(
329329
"This device is not whitelisted. Please contact "
@@ -1421,9 +1421,9 @@ void menuPointPerfect()
14211421
}
14221422
else if (incoming == 4 && pointPerfectIsEnabled())
14231423
{
1424-
char hardwareID[13];
1425-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
1426-
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5]);
1424+
char hardwareID[15];
1425+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
1426+
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant);
14271427
systemPrintf("Device ID: %s\r\n", hardwareID);
14281428
}
14291429
else if (incoming == 'c' && pointPerfectIsEnabled())

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ typedef uint8_t RtkMode_t;
7070
#define EQ_RTK_MODE(mode) (rtkMode && (rtkMode == (mode & rtkMode)))
7171
#define NEQ_RTK_MODE(mode) (rtkMode && (rtkMode != (mode & rtkMode)))
7272

73+
//Used as part of device ID and whitelists. Do not reorder.
7374
typedef enum
7475
{
7576
RTK_EVK = 0,

0 commit comments

Comments
 (0)