fix(mdns): Bekanntmachung auch im eigenen AP

This commit is contained in:
Michael Sauer
2026-10-02 10:47:10 +02:00
parent 24c4e38e4e
commit ded09a3516
+11 -1
View File
@@ -280,7 +280,8 @@ static void net_task(void *arg)
void *msg = NULL; void *msg = NULL;
nl_wifi_actions_t ev, tick; nl_wifi_actions_t ev, tick;
uint32_t m = 0, now; uint32_t m = 0, now;
bool got_ip_event = false, connected_now, ap_wanted, unexpected_softap; bool got_ip_event = false, connected_now, ap_wanted, unexpected_softap,
standalone_ap_up;
bool recheck_ap = false; bool recheck_ap = false;
memset(&ev, 0, sizeof ev); memset(&ev, 0, sizeof ev);
@@ -331,6 +332,9 @@ static void net_task(void *arg)
* clear_softap_param() touch the SDK's own state and must not run while s_lock * clear_softap_param() touch the SDK's own state and must not run while s_lock
* (which only guards s_sm and the credential buffers) is held. */ * (which only guards s_sm and the credential buffers) is held. */
unexpected_softap = m == (MSG_NETIF | NETIF_WIFI_SOFTAP_SUCCESS) && !ap_wanted; unexpected_softap = m == (MSG_NETIF | NETIF_WIFI_SOFTAP_SUCCESS) && !ap_wanted;
/* Nur die Lage merken; der Aufruf nach aussen folgt hinter der Entsperrung. */
standalone_ap_up = m == (MSG_NETIF | NETIF_WIFI_SOFTAP_SUCCESS) &&
s_sm.state == NL_WIFI_ST_STANDALONE;
unlock(); unlock();
if (unexpected_softap) { if (unexpected_softap) {
@@ -348,6 +352,12 @@ static void net_task(void *arg)
execute(tick); execute(tick);
if (got_ip_event && connected_now) if (got_ip_event && connected_now)
nl_mdns_on_ip_up(); nl_mdns_on_ip_up();
/* Im eigenen AP gibt es kein Stationsereignis, an dem mDNS haengen koennte.
* Ohne diesen Aufruf findet die App ein Standalone-Geraet nicht - am
* 2026-10-01 am EVK gemessen: REST auf der AP-IP lief, ninlight-681f.local
* war weder aufloesbar noch sichtbar. */
if (standalone_ap_up)
nl_mdns_on_ip_up();
/* M3: retry a softap create that failed, as long as the SM still wants the AP up. */ /* M3: retry a softap create that failed, as long as the SM still wants the AP up. */
if (s_ap_create_pending && ap_wanted && due_now(now, s_ap_create_retry_at)) { if (s_ap_create_pending && ap_wanted && due_now(now, s_ap_create_retry_at)) {