@@ -214,9 +214,9 @@ char *printDaysFromDuration(long long duration)
214
214
bool pointperfectProvisionDevice ()
215
215
{
216
216
#ifdef COMPILE_WIFI
217
- bool bluetoothOriginallyConnected = false ;
218
- if (bluetoothState == BT_CONNECTED )
219
- bluetoothOriginallyConnected = true ;
217
+ bool bluetoothOriginallyStarted = true ;
218
+ if (bluetoothState == BT_OFF )
219
+ bluetoothOriginallyStarted = false ;
220
220
221
221
bluetoothStop (); // Free heap before starting secure client (requires ~70KB)
222
222
@@ -396,7 +396,7 @@ bool pointperfectProvisionDevice()
396
396
if (jsonZtp)
397
397
delete jsonZtp;
398
398
399
- if (bluetoothOriginallyConnected == true )
399
+ if (bluetoothOriginallyStarted == true )
400
400
bluetoothStart ();
401
401
402
402
return (retVal);
@@ -527,9 +527,9 @@ void erasePointperfectCredentials()
527
527
bool pointperfectUpdateKeys ()
528
528
{
529
529
#ifdef COMPILE_WIFI
530
- bool bluetoothOriginallyConnected = false ;
531
- if (bluetoothState == BT_CONNECTED )
532
- bluetoothOriginallyConnected = true ;
530
+ bool bluetoothOriginallyStarted = true ;
531
+ if (bluetoothState == BT_OFF )
532
+ bluetoothOriginallyStarted = false ;
533
533
534
534
bluetoothStop (); // Release available heap to allow room for TLS
535
535
@@ -648,7 +648,7 @@ bool pointperfectUpdateKeys()
648
648
if (certificateContents)
649
649
free (certificateContents);
650
650
651
- if (bluetoothOriginallyConnected == true )
651
+ if (bluetoothOriginallyStarted == true )
652
652
bluetoothStart ();
653
653
654
654
// Return the key status
0 commit comments