Skip to content

Commit 01e3005

Browse files
committed
forceKeyAttempt becomes settings.requestKeyUpdate. Add to web config
1 parent b7c0d96 commit 01e3005

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,15 @@
11691169
</div>
11701170
</div>
11711171

1172+
<div class="form-check mt-3">
1173+
<label class="form-check-label" for="requestKeyUpdate">Request Key Update </label>
1174+
<input class="form-check-input" type="checkbox" value="" id="requestKeyUpdate">
1175+
<span class="tt" data-bs-placement="right"
1176+
title="When checked, the PointPerfect keys will be requested and updated at the next opportunity. Default: Disabled">
1177+
<span class="icon-info-circle text-primary ms-2"></span>
1178+
</span>
1179+
</div>
1180+
11721181
<div id="useAssistNowCheckbox">
11731182
<div class="form-check mt-3">
11741183
<label class="form-check-label" for="useAssistNow">AssistNow </label>

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,6 @@ unsigned long lastGnssToPpl = 0;
815815
int commandCount;
816816
int16_t *commandIndex;
817817

818-
volatile bool forceKeyAttempt = false; // Set to true to force a key provisioning attempt
819-
820818
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
821819

822820
// Display boot times

Firmware/RTK_Everywhere/States.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void stateUpdate()
503503
break;
504504

505505
case (STATE_KEYS_REQUESTED): {
506-
forceKeyAttempt = true; // Force a key update
506+
settings.requestKeyUpdate = true; // Force a key update
507507
changeState(lastSystemState); // Return to the last system state
508508
}
509509
break;

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ void menuPointPerfect()
958958
else
959959
systemPrintln("Disabled");
960960
systemPrint("3) Request Key Update: ");
961-
if (forceKeyAttempt == true)
961+
if (settings.requestKeyUpdate == true)
962962
systemPrintln("Requested");
963963
else
964964
systemPrintln("Not requested");
@@ -1003,18 +1003,18 @@ void menuPointPerfect()
10031003
{
10041004
settings.enablePointPerfectCorrections ^= 1;
10051005
restartRover = true; // Require a rover restart to enable / disable RTCM for PPL
1006-
forceKeyAttempt = settings.enablePointPerfectCorrections; // Force a key update - or don't
1006+
settings.requestKeyUpdate = settings.enablePointPerfectCorrections; // Force a key update - or don't
10071007
}
10081008

10091009
#ifdef COMPILE_NETWORK
10101010
else if (incoming == 2 && pointPerfectIsEnabled())
10111011
{
10121012
settings.autoKeyRenewal ^= 1;
1013-
forceKeyAttempt = settings.autoKeyRenewal; // Force a key update - or don't
1013+
settings.requestKeyUpdate = settings.autoKeyRenewal; // Force a key update - or don't
10141014
}
10151015
else if (incoming == 3 && pointPerfectIsEnabled())
10161016
{
1017-
forceKeyAttempt = forceKeyAttempt ^ 1;
1017+
settings.requestKeyUpdate ^= 1;
10181018
}
10191019
else if (incoming == 4 && pointPerfectIsEnabled())
10201020
{
@@ -1238,13 +1238,13 @@ void updateProvisioning()
12381238
{
12391239
if ((online.rtc)
12401240
|| (millis() > (provisioningStartTime + provisioningTimeout))
1241-
|| (forceKeyAttempt))
1241+
|| (settings.requestKeyUpdate))
12421242
provisioningSetState(PROVISIONING_NOT_STARTED);
12431243
}
12441244
break;
12451245
case PROVISIONING_NOT_STARTED:
12461246
{
1247-
if (settings.enablePointPerfectCorrections && (settings.autoKeyRenewal || forceKeyAttempt))
1247+
if (settings.enablePointPerfectCorrections && (settings.autoKeyRenewal || settings.requestKeyUpdate))
12481248
{
12491249
provisioningSetState(PROVISIONING_CHECK_REMAINING);
12501250
}
@@ -1314,7 +1314,8 @@ void updateProvisioning()
13141314
break;
13151315
case PROVISIONING_STARTING:
13161316
{
1317-
forceKeyAttempt = false;
1317+
settings.requestKeyUpdate = false;
1318+
recordSystemSettings(); // Record these settings to unit
13181319
ztpResponse = ZTP_NOT_STARTED; // HTTP_Client will update this
13191320
httpClientModeNeeded = true; // This will start the HTTP_Client
13201321
provisioningStartTime = millis(); // Record the start time so we can timeout
@@ -1436,7 +1437,7 @@ void updateProvisioning()
14361437
break;
14371438
case PROVISIONING_WAIT_ATTEMPT:
14381439
{
1439-
if (forceKeyAttempt)
1440+
if (settings.requestKeyUpdate)
14401441
provisioningSetState(PROVISIONING_STARTING);
14411442
else if (!settings.enablePointPerfectCorrections || !settings.autoKeyRenewal)
14421443
provisioningSetState(PROVISIONING_OFF);

Firmware/RTK_Everywhere/settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,8 @@ struct Settings
13741374
uint8_t localizedDistributionTileLevel = 5;
13751375
bool useAssistNow = false;
13761376

1377+
bool requestKeyUpdate = false; // Set to true to force a key provisioning attempt
1378+
13771379
// Add new settings to appropriate group above or create new group
13781380
// Then also add to the same group in rtkSettingsEntries below
13791381
} settings;
@@ -1883,6 +1885,8 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
18831885
{ 0, 1, 1, 0, 1, 1, 1, 1, _uint8_t, 0, & settings.localizedDistributionTileLevel, "localizedDistributionTileLevel", },
18841886
{ 0, 1, 1, 0, 1, 1, 0, 1, _bool, 0, & settings.useAssistNow, "useAssistNow", },
18851887

1888+
{ 0, 1, 1, 0, 1, 1, 1, 1, _bool, 0, & settings.requestKeyUpdate, "requestKeyUpdate", },
1889+
18861890
// Add new settings to appropriate group above or create new group
18871891
// Then also add to the same group in settings above
18881892
// F

0 commit comments

Comments
 (0)