Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey everyone.

I have a problem to share you with you guys.

Here is the situation:

I have 2 devices which are being controlled by pic (micro controller units). My computer and these 2 devices are connected to each other in a network. I can ping from my computer to these devices, there is no problem with that.

What I want to ask is how to broadcast a data to them? So, I can test the difference of signal destination time btw. them.

Any suggestions will be well appreciated.
My best regards..
Posted

If you want to use TCP connection, then there is NO broadcast. TCP[^] is a point to point protocol.
Check out UDP[^].
 
Share this answer
 
Comments
Mehdi Gholam 13-Sep-11 2:42am    
My 5!
Kim Togo 13-Sep-11 2:45am    
Thanks Mehdi.
Un_NaMeD 13-Sep-11 2:55am    
Hey Kim,
Thanks for warning. So, there is no way to broadcast using TCP connection.
Is there any code snippets, pseudocode or article to share about on programming with UDP?
Kim Togo 13-Sep-11 3:05am    
Google is your friend in need.

But there are many articles here at codeproject.

http://www.codeproject.com/KB/IP/#UDP

http://www.codeproject.com/KB/IP/multicast.aspx

To send data to a network device you can use the TcpClient class.

For this sending and receiving to work you must know the communication protocol of those devices, ie packet structure, handshaking etc.

I suggest finding the manuals for those devices and seeing how they communicate.
 
Share this answer
 
Comments
Un_NaMeD 13-Sep-11 2:53am    
Hey Mehdi,
I made the devices(which are electronic cards in fact). They are programmed to get messages on the ethernet port. There is no problem at that part.
Thanks anyway...
I am not 100% sure about that, but try a "broadcast address".

Let's assume your development PC to have IP 192.168.128.1/24. The address of the whole subnetwork would be 192.168.128.0/24.
A ping to 192.168.128.255 should make every device respond that is in the same subnetwork.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900