@@ -83,6 +83,11 @@ static uint32_t wifi_security_auth(uint8_t security)
8383 }
8484}
8585
86+ // Whether the current association was made with a passphrase. The CYW43 driver
87+ // has no getter for the auth mode of a live association, so remember what was
88+ // asked for at join time.
89+ static bool wifi_join_secured = false ;
90+
8691bool platform_network_supported ()
8792{
8893 /* from cores/rp2040/RP2040Support.h */
@@ -180,6 +185,8 @@ bool platform_network_wifi_join(char *ssid, char *password, bool reconnect)
180185 wifi_reconnect_time = platform_millis ();
181186 }
182187
188+ wifi_join_secured = (password != NULL && password[0 ] != 0 );
189+
183190 if (password == NULL || password[0 ] == 0 )
184191 {
185192 if (!reconnect)
@@ -437,11 +444,28 @@ char * platform_network_wifi_bssid()
437444
438445 memset (bssid, 0 , sizeof (bssid));
439446
440- /* TODO */
447+ int ret = cyw43_wifi_get_bssid (&cyw43_state, (uint8_t *)bssid);
448+ if (ret)
449+ {
450+ dbgmsg (" Failed getting Wi-Fi BSSID: " , ret);
451+ return NULL ;
452+ }
441453
442454 return bssid;
443455}
444456
457+ uint8_t platform_network_wifi_flags ()
458+ {
459+ if (!wifi_join_secured)
460+ return 0 ;
461+
462+ // Only claim authentication for an association that actually happened
463+ if (cyw43_wifi_link_status (&cyw43_state, CYW43_ITF_STA ) < CYW43_LINK_JOIN )
464+ return 0 ;
465+
466+ return WIFI_NETWORK_FLAG_AUTH ;
467+ }
468+
445469int platform_network_wifi_channel ()
446470{
447471 int32_t channel = 0 ;
0 commit comments