I am trying to write a linux code which will listen on a UDP port and revceive messages from Zyxel modems. (Zyxel modems have a remote packet tracing feature which uses UDP)
I achieved most of the task. The received packet is assigned to a string (char) variable.
But I need the 15th and 16th bytes of the received data to be converted to integer and assigned to an integer variable. (Because these bytes include the original packet size)
How can I get the 15 & 16th bytes of the char and calculate the integer value ?
With below example I can get the hex values to the string variable x. But that's not what I need. I need to get integer value.
Thanks for your help.