@@ -10,6 +10,9 @@ HTTP_Client.ino
1010
1111------------------------------------------------------------------------------*/
1212
13+ ZtpResponse ztpResponse =
14+ ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
15+
1316#ifdef COMPILE_HTTP_CLIENT
1417
1518// ----------------------------------------
@@ -46,9 +49,6 @@ const char *const httpClientStateName[] = {
4649
4750const int httpClientStateNameEntries = sizeof (httpClientStateName) / sizeof (httpClientStateName[0 ]);
4851
49- ZtpResponse ztpResponse =
50- ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
51-
5252// ----------------------------------------
5353// Locals
5454// ----------------------------------------
@@ -527,10 +527,12 @@ void httpClientUpdate()
527527 // If this is the first time this device has connected to ThingStream, they
528528 // will not be present and we need to retry
529529 // 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 ))
531532 {
532533 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
534536 break ;
535537 }
536538
@@ -561,8 +563,8 @@ void httpClientUpdate()
561563 // Note: from the ZTP documentation:
562564 // ["subscriptions"][0] will contain the key distribution topic
563565 // 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
566568 // plan, the path will be /pp/ubx/0236/Lb These 0236 key distribution topics provide the keys in
567569 // UBX format, ready to be pushed to a ZED. There are also /pp/key/ip and /pp/key/Lb topics
568570 // which provide the keys in JSON format - but we don't use those.
@@ -634,7 +636,8 @@ void httpClientUpdate()
634636 if ((const char *)((*jsonZtp)[" rtcmCredentials" ][" endpoint" ]) == nullptr )
635637 {
636638 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
638641 break ;
639642 }
640643
0 commit comments