|
16 | 16 | #define POINTPERFECT_TOKEN DEVELOPMENT_TOKEN
|
17 | 17 | #endif // POINTPERFECT_TOKEN
|
18 | 18 |
|
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 |
21 | 21 |
|
22 | 22 | static const char *pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
|
23 | 23 |
|
@@ -236,7 +236,7 @@ bool pointperfectProvisionDevice()
|
236 | 236 | {
|
237 | 237 | // Convert uint8_t array into string with dashes in spots
|
238 | 238 | // 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))) |
240 | 240 | systemPrintln("Warning: Using the development token!");
|
241 | 241 | for (int x = 0; x < sizeof(pointPerfectTokenArray); x++)
|
242 | 242 | {
|
@@ -1115,6 +1115,8 @@ void menuPointPerfect()
|
1115 | 1115 |
|
1116 | 1116 | systemPrintln("4) Show device ID");
|
1117 | 1117 |
|
| 1118 | + systemPrintln("c) Clear the Keys"); |
| 1119 | + |
1118 | 1120 | systemPrintln("k) Manual Key Entry");
|
1119 | 1121 |
|
1120 | 1122 | systemPrintln("x) Exit");
|
@@ -1186,6 +1188,11 @@ void menuPointPerfect()
|
1186 | 1188 | lbandMACAddress[2], lbandMACAddress[3], lbandMACAddress[4], lbandMACAddress[5]);
|
1187 | 1189 | systemPrintf("Device ID: %s\r\n", hardwareID);
|
1188 | 1190 | }
|
| 1191 | + else if (incoming == 'c') |
| 1192 | + { |
| 1193 | + settings.pointPerfectCurrentKey[0] = 0; |
| 1194 | + settings.pointPerfectNextKey[0] = 0; |
| 1195 | + } |
1189 | 1196 | else if (incoming == 'k')
|
1190 | 1197 | {
|
1191 | 1198 | menuPointPerfectKeys();
|
|
0 commit comments