Skip to content

Commit 2217b38

Browse files
authored
Merge pull request #683 from LeeLeahy2/pp-warning
menuPP: Print compiler & runtime warning when using the DEVELOPER_TOKEN
2 parents c279f98 + 4c79488 commit 2217b38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Firmware/RTK_Surveyor/menuPP.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
#define MQTT_CERT_SIZE 2000
1010

1111
// The PointPerfect token is provided at compile time via build flags
12-
#ifndef POINTPERFECT_TOKEN
13-
#define POINTPERFECT_TOKEN \
12+
#define DEVELOPMENT_TOKEN \
1413
0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03
14+
#ifndef POINTPERFECT_TOKEN
15+
#warning Using the DEVELOPMENT_TOKEN for point perfect!
16+
#define POINTPERFECT_TOKEN DEVELOPMENT_TOKEN
1517
#endif // POINTPERFECT_TOKEN
1618

19+
static uint8_t developmentTokenArray[16] = {DEVELOPMENT_TOKEN}; // Token in HEX form
1720
static uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; // Token in HEX form
1821

1922
static const char *pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
@@ -233,6 +236,8 @@ bool pointperfectProvisionDevice()
233236
{
234237
// Convert uint8_t array into string with dashes in spots
235238
// 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)))
240+
systemPrintln("Warning: Using the development token!");
236241
for (int x = 0; x < sizeof(pointPerfectTokenArray); x++)
237242
{
238243
char temp[3];

0 commit comments

Comments
 (0)