Hello everyone, I apologize for my poor English. I'm using Google Translate.
I've seen a lot of discussion about this issue on the forum, but it's now closed, with instructions to open new posts if needed.
'm not a programming expert; I still usually work with VB6.
This is my problem. I need to monitor multicast data traffic (sACN - protocol for lighting applications) emitted by an application on the address 239.255.0.X ( x is variable).
If I operate in broadcast or unicast (2.0.0.x), I can read the data; if I operate in multicast (239.x.x.x) , I can't.
I many post, I read that I need to add the enablement to the manifest (done),
and that I need the Jnetwork library, because the b4a one isn't suitable.
(ref to this old post > Android Question : how udp receive multicast packets)
Now the questions:
1. How do I download and add this library to b4a?
2. Do I need to add code to indicate the type of traffic, or is the code I use for broadcast reception already sufficient?
Now I use this simple code for test :
Sock initalize
Sock read
I have the impression that something is missing in the code...
Thanks to anyone who can offer advice.
Mario
I've seen a lot of discussion about this issue on the forum, but it's now closed, with instructions to open new posts if needed.
'm not a programming expert; I still usually work with VB6.
This is my problem. I need to monitor multicast data traffic (sACN - protocol for lighting applications) emitted by an application on the address 239.255.0.X ( x is variable).
If I operate in broadcast or unicast (2.0.0.x), I can read the data; if I operate in multicast (239.x.x.x) , I can't.
I many post, I read that I need to add the enablement to the manifest (done),
B4X:
AddPermission(android.permission.CHANGE_WIFI_MULTICAST_STATE)
(ref to this old post > Android Question : how udp receive multicast packets)
Now the questions:
1. How do I download and add this library to b4a?
2. Do I need to add code to indicate the type of traffic, or is the code I use for broadcast reception already sufficient?
Now I use this simple code for test :
Sock initalize
B4X:
UDPSocket2.Initialize("UDP2", 5568, 128)'
B4X:
Sub UDP2_PacketArrived(Packet2 As UDPPacket)
Dim data() As Byte = Packet2.Data
Dim msg As String ' stringa arrivata al socket da xaudio
msg = BytesToString(Packet2.Data, Packet2.Offset, Packet2.Length, "ASCII")
Thanks to anyone who can offer advice.
Mario
Last edited: