Skip to content

menuPP: Print compiler & runtime warning when using the DEVELOPER_TOKEN #683

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
9 changes: 7 additions & 2 deletions Firmware/RTK_Surveyor/menuPP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
#define MQTT_CERT_SIZE 2000

// The PointPerfect token is provided at compile time via build flags
#ifndef POINTPERFECT_TOKEN
#define POINTPERFECT_TOKEN \
#define DEVELOPMENT_TOKEN \
0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03
#ifndef POINTPERFECT_TOKEN
#warning Using the DEVELOPMENT_TOKEN for point perfect!
#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 char *pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
Expand Down Expand Up @@ -233,6 +236,8 @@ 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)))
systemPrintln("Warning: Using the development token!");
for (int x = 0; x < sizeof(pointPerfectTokenArray); x++)
{
char temp[3];
Expand Down