winforms - C# Discovery Request (SSDP M-SEARCH) -


good day,

i bought new sony camera allows remote functionality on wireless connection. far , works sony's official app on android phone. want create c# winforms app can connect device , manipulate features.

the device first requires discovery request ssdp m-search. can maybe point me c# winforms example ssdp m-search device discovery used. far i'm using udpclient , supplied ip , port connect sony's manual. code far:

static string ssdp_addr = "239.255.255.250"; static string ssdp_st = "urn:schemas-sony-com:service:scalarwebapi:1";  udpclient ucs = new udpclient(1900); string data = "m-search * http/1.1\r\n" +               "host: 239.255.255.250:1900\r\n" +               "st:" + ssdp_st + "\r\n" +               "man:\"ssdp:discover\"\r\n" +               "mx:3\r\n\r\n";  byte[] sendbytes = encoding.ascii.getbytes(data); ucs.connect("239.255.255.250", 1900); ucs.send(sendbytes, sendbytes.length); ucs.close();  ipendpoint remoteipendpoint = new ipendpoint(ipaddress.any, 1900); udpclient ucr = new udpclient(1900);  byte[] receivebytes = ucr.receive(ref remoteipendpoint); listboxinfo.items.add(encoding.ascii.getstring(receivebytes)); 

thank you.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -