Skip to content

Commit ac1cc04

Browse files
committed
Add LBand certificate check
1 parent b38666a commit ac1cc04

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
@@ -86,7 +86,14 @@ void menuPointPerfect()
8686
Serial.print("WiFi connected: ");
8787
Serial.println(WiFi.localIP());
8888

89-
if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectLBandTopic) == 0)
89+
//Check if we have certificates
90+
char fileName[80];
91+
sprintf(fileName, "/%s_%s_%d.txt", platformFilePrefix, "certificate", profileNumber);
92+
if(LittleFS.exists(fileName) == false)
93+
{
94+
provisionDevice(); //Connect to ThingStream API and get keys
95+
}
96+
else if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectLBandTopic) == 0)
9097
{
9198
provisionDevice(); //Connect to ThingStream API and get keys
9299
}
@@ -95,7 +102,7 @@ void menuPointPerfect()
95102
}
96103

97104
stopWiFi();
98-
#endif
105+
#endif
99106
}
100107
else if (incoming == '6')
101108
{
@@ -356,7 +363,7 @@ bool provisionDevice()
356363
Serial.println("Device successfully provisioned. Keys obtained.");
357364

358365
recordSystemSettings();
359-
366+
360367
return (true);
361368
#else
362369
return (false);

0 commit comments

Comments
 (0)