mDNS is an NWP service that can be started or stopped with:
- sl_NetAppStart(SL_NET_APP_MDNS_ID);
- sl_NetAppStop(SL_NET_APP_MDNS_ID);
The macro SL_NET_APP_MDNS_ID is the definition of mDNS service.
mDNS frames (advertise, response to queries) are sent only if there is a valid IP address, which means mDNS works if one of the following wlan status is met:
- Simplelink is connected to AP as a station
- Simplelink P2P mode is running, either as a group owner (GO) or a client
- Simplelink AP mode is running
Be aware that sl_NetAppStart() and sl_NetAppStop() functions are:
- Persistent - The state is stored in the serial flash and will retain its previous state even after a power cycle.
- Role depended - The state cannot be shared across different roles. For example, if Simplelink is currently in AP mode with NetApp started, switching to STA mode will require the NetApp to start again, if it was previously disabled during STA mode. Other Netapp configurations such as registered services (for example, sl_NetAppMDNSRegisterService()) are not affected by role changes.