@@ -10,6 +10,9 @@ HTTP_Client.ino
10
10
11
11
------------------------------------------------------------------------------*/
12
12
13
+ ZtpResponse ztpResponse =
14
+ ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
15
+
13
16
#ifdef COMPILE_HTTP_CLIENT
14
17
15
18
// ----------------------------------------
@@ -46,9 +49,6 @@ const char *const httpClientStateName[] = {
46
49
47
50
const int httpClientStateNameEntries = sizeof (httpClientStateName) / sizeof (httpClientStateName[0 ]);
48
51
49
- ZtpResponse ztpResponse =
50
- ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
51
-
52
52
// ----------------------------------------
53
53
// Locals
54
54
// ----------------------------------------
@@ -527,10 +527,12 @@ void httpClientUpdate()
527
527
// If this is the first time this device has connected to ThingStream, they
528
528
// will not be present and we need to retry
529
529
// httpClientConnectLimitReached will prevent excessive retries
530
- if (((const char *)((*jsonZtp)[" certificate" ]) == nullptr ) || ((const char *)((*jsonZtp)[" privateKey" ]) == nullptr ))
530
+ if (((const char *)((*jsonZtp)[" certificate" ]) == nullptr ) ||
531
+ ((const char *)((*jsonZtp)[" privateKey" ]) == nullptr ))
531
532
{
532
533
systemPrintln (" ERROR - certificate or privateKey not found!\r\n " );
533
- httpClientRestart (); // Try again - allow time for ThingStream to finish activating the device on plan
534
+ httpClientRestart (); // Try again - allow time for ThingStream to finish activating the device
535
+ // on plan
534
536
break ;
535
537
}
536
538
@@ -561,8 +563,8 @@ void httpClientUpdate()
561
563
// Note: from the ZTP documentation:
562
564
// ["subscriptions"][0] will contain the key distribution topic
563
565
// But, assuming the key distribution topic is always ["subscriptions"][0] is potentially
564
- // brittle. It is safer to check the "description" contains "key distribution topic". If we are on
565
- // an IP-only plan, the path will be /pp/ubx/0236/ip If we are on a L-Band-only or L-Band+IP
566
+ // brittle. It is safer to check the "description" contains "key distribution topic". If we are
567
+ // on an IP-only plan, the path will be /pp/ubx/0236/ip If we are on a L-Band-only or L-Band+IP
566
568
// plan, the path will be /pp/ubx/0236/Lb These 0236 key distribution topics provide the keys in
567
569
// UBX format, ready to be pushed to a ZED. There are also /pp/key/ip and /pp/key/Lb topics
568
570
// which provide the keys in JSON format - but we don't use those.
@@ -634,7 +636,8 @@ void httpClientUpdate()
634
636
if ((const char *)((*jsonZtp)[" rtcmCredentials" ][" endpoint" ]) == nullptr )
635
637
{
636
638
systemPrintln (" ERROR - rtcmCredentials not found!\r\n " );
637
- httpClientRestart (); // Try again - allow time for ThingStream to finish activating the device on plan
639
+ httpClientRestart (); // Try again - allow time for ThingStream to finish activating the device
640
+ // on plan
638
641
break ;
639
642
}
640
643
0 commit comments