Android Question What is the best way to receive packets from multiple systems

mscientist33

Active Member
Licensed User
I have a tablet that sends out a broadcast message to multiple systems. In the packet it contains a system ID, or it could contain an ID that represents multiple systems and then it could also contain an ID that represents all the systems. Once the packet is sent out, each system reads the packet, if it pertains to them they do what is commanded based off the rest of the packet.

One of the commands sent is a status command and it is the only time the systems send data back to the tablet. The tablet has a static IP address, the systems are given an IP address by an Access Point (their ID is set by a hardware BCD knobs). The status response sends the ID then status back in the packets.

How or what is the best way to ensure I get all the packets? I am currently using UDPSockets. I have a send Socket with a specific port and a receive socket using another port. All works well as long as I am only testing with one system. My question is what is the best way to design this for multiple responses? Can I stack the packets from the Received_PacketArrived sub into some sort of queue? Can the Received_PacketArrived sub handle multiple packets arriving at the same time? I can have up to 300 systems that the tablet controls. I could just request one at a time with I was hoping there was a better way. I was hoping to send the ALL status command and every one could send back but I'm not sure how the socket would handle that.
 

mscientist33

Active Member
Licensed User
The systems that the tablet talk to are not android or windows. They are embedded systems that send out serial data through a serial to wifi module. Would MQTT still fit that scenario?
 
Upvote 0

mscientist33

Active Member
Licensed User
They do not support it. Can the Received_PacketArrived sub handle multiple packets arriving at the same time? or maybe or each packet when it arrives to put it in the queue then let a timer do the things I need to do with the data in the queue? Or do you guys have any other idea on how to implement this?
 
Upvote 0
Top