Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release candidate #223

Merged
merged 4 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Firmware/RTK_Everywhere/Display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Firmware/RTK_Everywhere/form.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// python main_js_zipper.py

static const uint8_t main_js[] PROGMEM = {
0x1F, 0x8B, 0x08, 0x08, 0xCA, 0x13, 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,
Expand Down Expand Up @@ -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, 0xCA, 0x13, 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,
Expand Down
6 changes: 3 additions & 3 deletions Firmware/RTK_Everywhere/menuCommands.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions Firmware/RTK_Everywhere/menuPP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "
"[email protected] to renew the PointPerfect "
Expand All @@ -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 "
Expand Down Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions Firmware/RTK_Everywhere/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading