I think I have found the github source for UPnP Tool:
(It seems to be the same author)
I will get it a look later
I have sent an email to the UPnP Tool guy, he confirm for the github code, here is it's full reply:
M-SEARCH packet sent from UPnP Tool is like this and you can also check it or more packet logs by clicking "LOG…” Button on the main screen
If you need a java code sending M-SEARCH via datagram socket, please check this code
Above code is mine and very similar to UPnP Tool’s code
So the code that he use is:
String customQuery = "M-SEARCH * HTTP/1.1\r\n" + "HOST: 22.214.171.124:1900\r\n" + "MAN: \"ssdp:discover\"\r\n" + "MX: 3\r\n" + "ST: upnp:rootdevice\r\n" + "USER-AGENT: Android/27 UPnP/1.1 UPnPTool/1.5.1" + "\r\n";
Unfortunately, that didn't help me to find the device. So we need to dig more in the datagram thing, but I'm not familiar too
Your tool is working ! Here is a screenshot :
I don't know for UTF-8, I'm using this upnp api: https://github.com/custanator/android-upnp-discovery
@grolschie thanks but i have already try this. Here is my request, maybe another parameter is wrong? :
String customQuery = "M-SEARCH * HTTP/1.1" + "\r\n" + "HOST: 126.96.36.199:1900" + "\r\n" +
"MAN: "ssdp:discover"" + "\r\n" + "MX: 1\r\n"+ "ST: ssdp:all\r\n" + "\r\n";
@david tkanks it works !
I recently bought the sound bar HT-ZF9
So how to switch to: TV / HDMI1 and HDMI2 ?
And is there an API to launch the Home button and navigate ?
Here is my MediaRenderer_HT-ZF9.xml :