I am a newbie. I have been programming in C but never used to socket/ioctl or accessing devices.
Here is my question.
I have to read data from my ethernet interface en0. I expect packets which give me the speed of motor. I have to store these values in a buffer.
I have to read the the interface every 1 second.
I have thought of the following.
Please help me out:
I set interupt which calls my read function. This function should access en0.
Do I use sockets? Should I open a socket to connect to en0 and then simply read this into my buffer?
Should I handle the packet for the data I want?
Should I do a TCP or IP socket? Ultimately I have to extract the velocity value. Does this mean I have to do some packet handling or are there some OS level handlers that I should use?
Where can I find more information on all this? I read a socket tutorial but there is nothing on packet handling.