@@ -177,6 +177,10 @@ void menuPointPerfectKeys()
177
177
bool pointperfectProvisionDevice ()
178
178
{
179
179
#ifdef COMPILE_WIFI
180
+ bool bluetoothOriginallyConnected = false ;
181
+ if (bluetoothState == BT_CONNECTED)
182
+ bluetoothOriginallyConnected = true ;
183
+
180
184
bluetoothStop (); // Free heap before starting secure client (requires ~70KB)
181
185
182
186
DynamicJsonDocument *jsonZtp = nullptr ;
@@ -202,7 +206,6 @@ bool pointperfectProvisionDevice()
202
206
char givenName[100 ];
203
207
char versionString[9 ];
204
208
getFirmwareVersion (versionString, sizeof (versionString), false );
205
- systemPrintf (" versionString: %s\r\n " , versionString);
206
209
207
210
if (productVariant == RTK_FACET_LBAND)
208
211
{
@@ -334,7 +337,8 @@ bool pointperfectProvisionDevice()
334
337
if (jsonZtp)
335
338
delete jsonZtp;
336
339
337
- bluetoothStart ();
340
+ if (bluetoothOriginallyConnected == true )
341
+ bluetoothStart ();
338
342
339
343
return (retVal);
340
344
#else // COMPILE_WIFI
@@ -433,6 +437,10 @@ void erasePointperfectCredentials()
433
437
bool pointperfectUpdateKeys ()
434
438
{
435
439
#ifdef COMPILE_WIFI
440
+ bool bluetoothOriginallyConnected = false ;
441
+ if (bluetoothState == BT_CONNECTED)
442
+ bluetoothOriginallyConnected = true ;
443
+
436
444
bluetoothStop (); // Release available heap to allow room for TLS
437
445
438
446
char *certificateContents = nullptr ; // Holds the contents of the keys prior to MQTT connection
@@ -550,7 +558,8 @@ bool pointperfectUpdateKeys()
550
558
if (certificateContents)
551
559
free (certificateContents);
552
560
553
- bluetoothStart ();
561
+ if (bluetoothOriginallyConnected == true )
562
+ bluetoothStart ();
554
563
555
564
// Return the key status
556
565
return (gotKeys);
0 commit comments