Skip to content

Commit

Permalink
Stop provisioning process once limit is reached.
Browse files Browse the repository at this point in the history
Fix #319
  • Loading branch information
nseidle committed May 28, 2024
1 parent 20ae5c6 commit a1ec83f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Firmware/RTK_Everywhere/menuPP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ bool pointperfectProvisionDevice()

do
{
provisionAttempt++;

char hardwareID[15];
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5],
Expand Down Expand Up @@ -342,6 +344,7 @@ bool pointperfectProvisionDevice()
landingPageUrl, hardwareID);

displayAccountExpired(5000);
break;
}
else if (ztpResponse == ZTP_NOT_WHITELISTED)
{
Expand All @@ -362,6 +365,7 @@ bool pointperfectProvisionDevice()
landingPageUrl, hardwareID);

displayNotListed(5000);
break;
}
else if (ztpResponse == ZTP_ALREADY_REGISTERED)
{
Expand All @@ -373,11 +377,11 @@ bool pointperfectProvisionDevice()
systemPrintf("This device is registered on a different profile. Please contact "
"[email protected] for more assistance. Please reference device ID: %s\r\n",
hardwareID);
break;
}
else if (ztpResponse == ZTP_RESPONSE_TIMEOUT)
{
// The WiFi failed to connect in a timely manner to the API.
provisionAttempt++;
if (provisionAttempt < maxProvisionAttempts)
systemPrintf("Provision server response timed out. Trying again.\r\n");
else
Expand All @@ -386,7 +390,6 @@ bool pointperfectProvisionDevice()
else
{
// Unknown error
provisionAttempt++;
if (provisionAttempt < maxProvisionAttempts)
systemPrintf("Unknown provisioning error. Trying again.\r\n");
else
Expand Down

0 comments on commit a1ec83f

Please sign in to comment.