Not applicable
Jun 23, 2016
09:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 23, 2016
09:02 AM
Hi everyone,
How can I do a check on received UDP message and react to it.
For example if the message was “1234” then do task 1
If the message was “4321” do task 2
Else do task 3.
The conditions are not so many. The messages are coming from a PC and I know the messages.
First idea came to my mind was to covert the struct to hex and compare the hex equivalent like if (hex (message) == hex(1234)) { … }
But I don’t know if it will work or not. And also I could not find the command to convert the struct into the hex.
Does anybody know which command I can use? Do I need to include any header file as well?
Thanks in advance for support.
sincerely,
H. Hafezi
How can I do a check on received UDP message and react to it.
For example if the message was “1234” then do task 1
If the message was “4321” do task 2
Else do task 3.
The conditions are not so many. The messages are coming from a PC and I know the messages.
First idea came to my mind was to covert the struct to hex and compare the hex equivalent like if (hex (message) == hex(1234)) { … }
But I don’t know if it will work or not. And also I could not find the command to convert the struct into the hex.
Does anybody know which command I can use? Do I need to include any header file as well?
Thanks in advance for support.
sincerely,
H. Hafezi
- Tags:
- IFX
0 Replies