Switch from broadcasting on "255.255.255.255" and checking if on mobile data to broadcasting link-local on compatible network interfaces.
"255.255.255.255" only works well on normal WiFi. While tethering, the packets may leak to the phone network, and/or not reach tethered clients. This problem is avoided with link-local addresses like "192.168.X.255". Using link-local addresses also makes it easier to support IPv6 in the future.
Support clients on:
- WiFi tethering (even with nobody connected)
- Bluetooth tethering
- USB tethering