@@ -221,6 +221,8 @@ bool pointperfectProvisionDevice()
221
221
222
222
do
223
223
{
224
+ provisionAttempt++;
225
+
224
226
char hardwareID[15 ];
225
227
snprintf (hardwareID, sizeof (hardwareID), " %02X%02X%02X%02X%02X%02X%02X" , btMACAddress[0 ], btMACAddress[1 ],
226
228
btMACAddress[2 ], btMACAddress[3 ], btMACAddress[4 ], btMACAddress[5 ],
@@ -342,6 +344,7 @@ bool pointperfectProvisionDevice()
342
344
landingPageUrl, hardwareID);
343
345
344
346
displayAccountExpired (5000 );
347
+ break ;
345
348
}
346
349
else if (ztpResponse == ZTP_NOT_WHITELISTED)
347
350
{
@@ -362,6 +365,7 @@ bool pointperfectProvisionDevice()
362
365
landingPageUrl, hardwareID);
363
366
364
367
displayNotListed (5000 );
368
+ break ;
365
369
}
366
370
else if (ztpResponse == ZTP_ALREADY_REGISTERED)
367
371
{
@@ -373,11 +377,11 @@ bool pointperfectProvisionDevice()
373
377
systemPrintf (" This device is registered on a different profile. Please contact "
374
378
" [email protected] for more assistance. Please reference device ID: %s\r\n " ,
375
379
hardwareID);
380
+ break ;
376
381
}
377
382
else if (ztpResponse == ZTP_RESPONSE_TIMEOUT)
378
383
{
379
384
// The WiFi failed to connect in a timely manner to the API.
380
- provisionAttempt++;
381
385
if (provisionAttempt < maxProvisionAttempts)
382
386
systemPrintf (" Provision server response timed out. Trying again.\r\n " );
383
387
else
@@ -386,7 +390,6 @@ bool pointperfectProvisionDevice()
386
390
else
387
391
{
388
392
// Unknown error
389
- provisionAttempt++;
390
393
if (provisionAttempt < maxProvisionAttempts)
391
394
systemPrintf (" Unknown provisioning error. Trying again.\r\n " );
392
395
else
0 commit comments