I try to send an SSDP Broadcast to my network.
The following Code doesnt work in B4J (get no response) But it will be send (according to WireShark). My PC is connected to the same Network via EthernetCable.
In B4A (of course wiFi) it works like a charm. Is there any known Problem to send such a broadcast message through Ethernet instead of WiFi? The devices wich should respond are also WiFi devices.
The following Code doesnt work in B4J (get no response) But it will be send (according to WireShark). My PC is connected to the same Network via EthernetCable.
In B4A (of course wiFi) it works like a charm. Is there any known Problem to send such a broadcast message through Ethernet instead of WiFi? The devices wich should respond are also WiFi devices.
B4X:
Public Sub Search
udp1.Initialize("UDP1", 1982, 1000)
Dim sb As StringBuilder
sb.Initialize
sb.Append("M-SEARCH * HTTP/1.1").Append(Chr(13) & Chr(10))
sb.Append("HOST: 239.255.255.250:1982").Append(Chr(13) & Chr(10))
sb.Append("MAN: " & Chr(34) & "ssdp:discover" & Chr(34)).Append(Chr(13) & Chr(10))
sb.Append("ST: wifi_bulb").Append(Chr(13) & Chr(10))
Dim package As UDPPacket
package.Initialize(sb.ToString.GetBytes("UTF8"),"239.255.255.250",1982)
udp1.Send(package)
End Sub
Sub UDP1_PacketArrived (Packet As UDPPacket)
Log(Packet.toString)
End Sub
Last edited: