Fix igiRadio app discovery: publish mDNS service, scan real subnet

The Bonjour browse for _http._tcp in DigiRadioDiscoveryService never
found the device because the firmware only called mdns_hostname_set()
(answers direct A-record lookups) and never mdns_service_add() (needed
for service browse to see it at all).

The app's LAN-scan fallback also assumed a /24 subnet, so it silently
missed devices on networks with a narrower mask (e.g. /22) when the
phone and the device land in different third-octet blocks of the same
network.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018iiTF1KGJBzY9zzpnz9Zr2
This commit is contained in:
2026-09-03 20:00:52 +02:00
co-authored by Claude Sonnet 5
parent 5f46486d46
commit e4ca925801
2 changed files with 90 additions and 0 deletions
@@ -354,6 +354,12 @@ StaClient::connect(const core::WifiCredentials& creds,
if (!hostLabel.empty()) {
if (mdns_init() == ESP_OK) {
mdns_hostname_set(hostLabel.c_str());
// Publishes the PTR/SRV/TXT records the app's Bonjour
// browse (_http._tcp) needs to discover this device.
// mdns_hostname_set() alone only answers direct A-record
// lookups of <hostLabel>.local, which a browse never sends.
mdns_service_add(hostLabel.c_str(), "_http", "_tcp", 80,
nullptr, 0);
}
}
ESP_LOGI(kTag, "connected to %.*s",