@@ -480,11 +480,11 @@ void NetWizard::_generateStatusJson(String& str) {
480480 #else
481481 DynamicJsonDocument json (NETWIZARD_STATUS_JSON_SIZE);
482482 #endif
483- json[" conn" ][" status" ] = _nw.status ;
483+ json[" conn" ][" status" ] = ( uint8_t ) _nw.status ;
484484 json[" conn" ][" ssid" ] = _nw.sta .ssid .c_str ();
485485 json[" conn" ][" mac" ] = WiFi.macAddress ();
486486 json[" conn" ][" ip" ] = WiFi.localIP ().toString ();
487- json[" portal" ][" state" ] = _nw.portal .state ;
487+ json[" portal" ][" state" ] = ( uint8_t ) _nw.portal .state ;
488488
489489 // Serialize JSON to string
490490 serializeJson (json, str);
@@ -574,76 +574,78 @@ void NetWizard::_generateScanJson(String& str) {
574574 // MAX,
575575 // }
576576
577+ NetWizardEncryptionType enc = NetWizardEncryptionType::OPEN;
577578 #if defined(ESP8266) || defined(ESP32)
578579 switch (WiFi.encryptionType (i)) {
579580 case WIFI_AUTH_OPEN:
580- obj[ " e " ] = NetWizardEncryptionType::OPEN;
581+ enc = NetWizardEncryptionType::OPEN;
581582 break ;
582583 case WIFI_AUTH_WEP:
583- obj[ " e " ] = NetWizardEncryptionType::WEP;
584+ enc = NetWizardEncryptionType::WEP;
584585 break ;
585586 case WIFI_AUTH_WPA_PSK:
586- obj[ " e " ] = NetWizardEncryptionType::WPA_PSK;
587+ enc = NetWizardEncryptionType::WPA_PSK;
587588 break ;
588589 case WIFI_AUTH_WPA2_PSK:
589- obj[ " e " ] = NetWizardEncryptionType::WPA2_PSK;
590+ enc = NetWizardEncryptionType::WPA2_PSK;
590591 break ;
591592 case WIFI_AUTH_WPA_WPA2_PSK:
592- obj[ " e " ] = NetWizardEncryptionType::WPA_WPA2_PSK;
593+ enc = NetWizardEncryptionType::WPA_WPA2_PSK;
593594 break ;
594595 // case WIFI_AUTH_ENTERPRISE:
595- // obj["e"] = NetWizardEncryptionType::ENTERPRISE;
596+ // enc = NetWizardEncryptionType::ENTERPRISE;
596597 // break;
597598 case WIFI_AUTH_WPA2_ENTERPRISE:
598- obj[ " e " ] = NetWizardEncryptionType::WPA2_ENTERPRISE;
599+ enc = NetWizardEncryptionType::WPA2_ENTERPRISE;
599600 break ;
600601 case WIFI_AUTH_WPA3_PSK:
601- obj[ " e " ] = NetWizardEncryptionType::WPA3_PSK;
602+ enc = NetWizardEncryptionType::WPA3_PSK;
602603 break ;
603604 case WIFI_AUTH_WPA2_WPA3_PSK:
604- obj[ " e " ] = NetWizardEncryptionType::WPA2_WPA3_PSK;
605+ enc = NetWizardEncryptionType::WPA2_WPA3_PSK;
605606 break ;
606607 case WIFI_AUTH_WAPI_PSK:
607- obj[ " e " ] = NetWizardEncryptionType::WAPI_PSK;
608+ enc = NetWizardEncryptionType::WAPI_PSK;
608609 break ;
609610 case WIFI_AUTH_OWE:
610- obj[ " e " ] = NetWizardEncryptionType::OWE;
611+ enc = NetWizardEncryptionType::OWE;
611612 break ;
612613 case WIFI_AUTH_WPA3_ENT_192:
613- obj[ " e " ] = NetWizardEncryptionType::WPA3_ENT_192;
614+ enc = NetWizardEncryptionType::WPA3_ENT_192;
614615 break ;
615616 // case WIFI_AUTH_WPA3_EXT_PSK:
616- // obj["e"] = NetWizardEncryptionType::WPA3_EXT_PSK;
617+ // enc = NetWizardEncryptionType::WPA3_EXT_PSK;
617618 // break;
618619 // case WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE:
619- // obj["e"] = NetWizardEncryptionType::WPA3_EXT_PSK_MIXED_MODE;
620+ // enc = NetWizardEncryptionType::WPA3_EXT_PSK_MIXED_MODE;
620621 // break;
621622 case WIFI_AUTH_MAX:
622- obj[ " e " ] = NetWizardEncryptionType::MAX;
623+ enc = NetWizardEncryptionType::MAX;
623624 break ;
624625 default :
625- obj[ " e " ] = NetWizardEncryptionType::UNKNOWN;
626+ enc = NetWizardEncryptionType::UNKNOWN;
626627 break ;
627628 }
628629 #elif defined(TARGET_RP2040)
629630 switch (WiFi.encryptionType (i)) {
630631 case ENC_TYPE_NONE:
631- obj[ " e " ] = NetWizardEncryptionType::OPEN;
632+ enc = NetWizardEncryptionType::OPEN;
632633 break ;
633634 case ENC_TYPE_TKIP:
634- obj[ " e " ] = NetWizardEncryptionType::WPA_PSK;
635+ enc = NetWizardEncryptionType::WPA_PSK;
635636 break ;
636637 case ENC_TYPE_CCMP:
637- obj[ " e " ] = NetWizardEncryptionType::WPA2_PSK;
638+ enc = NetWizardEncryptionType::WPA2_PSK;
638639 break ;
639640 case ENC_TYPE_AUTO:
640- obj[ " e " ] = NetWizardEncryptionType::WPA_WPA2_PSK;
641+ enc = NetWizardEncryptionType::WPA_WPA2_PSK;
641642 break ;
642643 default :
643- obj[ " e " ] = NetWizardEncryptionType::UNKNOWN;
644+ enc = NetWizardEncryptionType::UNKNOWN;
644645 break ;
645646 }
646647 #endif
648+ obj[" e" ] = (uint8_t )enc;
647649 }
648650 serializeJson (json, str);
649651 json.clear ();
0 commit comments