Skip to content

Commit 0f23e26

Browse files
authored
Merge pull request #685 from LeeLeahy2/clear-keys
menuPP: Add menu item to clear the keys
2 parents 7cc094b + 21bb996 commit 0f23e26

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#define POINTPERFECT_TOKEN DEVELOPMENT_TOKEN
1717
#endif // POINTPERFECT_TOKEN
1818

19-
static uint8_t developmentTokenArray[16] = {DEVELOPMENT_TOKEN}; // Token in HEX form
20-
static uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; // Token in HEX form
19+
static const uint8_t developmentTokenArray[16] = {DEVELOPMENT_TOKEN}; // Token in HEX form
20+
static const uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; // Token in HEX form
2121

2222
static const char *pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
2323

@@ -236,7 +236,7 @@ bool pointperfectProvisionDevice()
236236
{
237237
// Convert uint8_t array into string with dashes in spots
238238
// We must assume u-blox will not change the position of their dashes or length of their token
239-
if (memcmp(pointPerfectTokenArray, developmentTokenArray, sizeof(developmentTokenArray)))
239+
if (!memcmp(pointPerfectTokenArray, developmentTokenArray, sizeof(developmentTokenArray)))
240240
systemPrintln("Warning: Using the development token!");
241241
for (int x = 0; x < sizeof(pointPerfectTokenArray); x++)
242242
{
@@ -1115,6 +1115,8 @@ void menuPointPerfect()
11151115

11161116
systemPrintln("4) Show device ID");
11171117

1118+
systemPrintln("c) Clear the Keys");
1119+
11181120
systemPrintln("k) Manual Key Entry");
11191121

11201122
systemPrintln("x) Exit");
@@ -1186,6 +1188,11 @@ void menuPointPerfect()
11861188
lbandMACAddress[2], lbandMACAddress[3], lbandMACAddress[4], lbandMACAddress[5]);
11871189
systemPrintf("Device ID: %s\r\n", hardwareID);
11881190
}
1191+
else if (incoming == 'c')
1192+
{
1193+
settings.pointPerfectCurrentKey[0] = 0;
1194+
settings.pointPerfectNextKey[0] = 0;
1195+
}
11891196
else if (incoming == 'k')
11901197
{
11911198
menuPointPerfectKeys();

0 commit comments

Comments
 (0)