Skip to content

menuPP: Add menu item to clear the keys #685

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

Merged
merged 1 commit into from
Sep 28, 2023
Merged
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: 10 additions & 3 deletions Firmware/RTK_Surveyor/menuPP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#define POINTPERFECT_TOKEN DEVELOPMENT_TOKEN
#endif // POINTPERFECT_TOKEN

static uint8_t developmentTokenArray[16] = {DEVELOPMENT_TOKEN}; // Token in HEX form
static uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; // Token in HEX form
static const uint8_t developmentTokenArray[16] = {DEVELOPMENT_TOKEN}; // Token in HEX form
static const uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; // Token in HEX form

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

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

systemPrintln("4) Show device ID");

systemPrintln("c) Clear the Keys");

systemPrintln("k) Manual Key Entry");

systemPrintln("x) Exit");
Expand Down Expand Up @@ -1186,6 +1188,11 @@ void menuPointPerfect()
lbandMACAddress[2], lbandMACAddress[3], lbandMACAddress[4], lbandMACAddress[5]);
systemPrintf("Device ID: %s\r\n", hardwareID);
}
else if (incoming == 'c')
{
settings.pointPerfectCurrentKey[0] = 0;
settings.pointPerfectNextKey[0] = 0;
}
else if (incoming == 'k')
{
menuPointPerfectKeys();
Expand Down