cybergarage / cybergarage-upnp

cybergarage-upnp is a development package for UPnP™ developers. cybergarage-upnp controls these protocols automatically, and supports to create your devices and control points quickly.

Home Page:http://www.cybergarage.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ControlPoint.start(target) not discovering the devices on Android Q

aKummur opened this issue · comments

I am trying to discover my target device from my android application. It worked so far. Now I am trying this on Android Q and my target is not getting discovered.
The same code discovers my target device on lower versions of android (P, O). No errors thrown.
I can see the search packet being broadcasted.

My target device does get listed if I remove the ST: parameter from my search on Anroid Q. I mean ssdp:all lists it. When I add the target parameter to the start() method, it doesn't list my target device. What could be going wrong ?
Any help is appreciated.

Solved this issue.
This is because of the Multicast packets filtered out by the Android platform - https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock

Since the SSDP Notify multicast packets were getting filtered out, the socket was not receiving any advertisements and hence not discovering any devices.

Acquire the Multicast lock and this issue will resolve.