Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 10:37 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed Feb 11, 2009 9:35 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Hello,

Are there any code examples that show me how to listen to ethernet broadcast messages? I'm new to Clarity and I checked the forums and documentation but I was not able to find any information.

Thank you


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 9:38 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Are you referring to raw Ethernet broadcasts or to UDP network broadcasts?

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 9:44 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
I'm sorry to say I don't know the answer to that. Wireshark says the protocol is WCCP if that helps. I'm new to dealing with broadcast messages. Is there a large difference in how it's handled in Clarity?


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 10:05 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Maybe we should get some more background on your project, and how far along you are with Qlarity. Can you tell me about the device your attempting to communicate with? Is there a standard protocol that your device uses to communicate? Can you ping this other device from your PC (i.e. using the command line: ping xxx.xxx.xxx.xx, where xxx.xxx.xxx.xxx is your devices IP address)?

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 10:33 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Ron,

The device can be pinged and it broadcasts status information over a specific socket. The contents of the packet is our own protocol that I need to decode and display in the hand held (G55 with ethernet). My clarity skills are only a few days old but I get the gist of it. I need to create a template that takes the data from the broadcast and fire's events which will be hooked up in the display.

Thanks
Joe


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 10:42 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
It sounds like your using UDP as the underlying method to send your packets. I would start out with the EthernetServer example (Help->Object Documentation->Content->Samples), and see if you can use that to receive and display the contents of your packets in Simulation View.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 12:58 pm 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Ron,

I think you meant the ethernetclient example. I want to listen for broadcast messages not post them.

The problem I'm experiencing is that the ethernetclient requires a destination IP address. I'm listening for broadcast messages so I don't believe I should supply an IP address, only a port. I tried using 127.0.0.1 and the IP address of the device sending the broadcast but I'm not getting data. The client connects, but no data is being fed.

I added a _print in the datareceived event to let me know something was received and I looked in the communication window. I have a test app written in Java that is receiving data so I know it's not the device or the network.

Thanks,
Joe


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 1:05 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
I do mean the EthernetServer. In general a server listens for other devices, and a client actively looks for devices. In this scenario with UDP, the server would listen for incoming UDP packets.

Quote:
The problem I'm experiencing is that the ethernetclient requires a destination IP address.
That is because a client is generally a device who initiates communication.

Try the EthernetServer example and set the local port number to the port number that your device is sending packets to.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 1:08 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Ironically, when you are listening to UDP broadcasts, you want to be a server and NOT a client. As you pointed out, when you were a client you needed to know the IP address of the other device -- obviously not what you want.

However, when you are a server, you accept incoming data from any device that cares to send to you.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Wed Feb 11, 2009 1:13 pm 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Thank you very much. This worked and I'm now getting data.

Thank you for the prompt responses.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group