LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   is sockets programming my only way? (https://www.linuxquestions.org/questions/programming-9/is-sockets-programming-my-only-way-539927/)

nesta 03-23-2007 09:44 AM

is sockets programming my only way?
 
hi all,
i have an OMAP kit that is connected to my pc using network-cable.
if i wanna write programs that can communicate with my kit,

so the only way to do that is through sockets programming?

isnt there any other way to do that?

note that my knowledge for C under linux or shell-scripts
not bad?

thanks in advance

theNbomr 03-23-2007 10:37 AM

If your OMAP device (and I don't know what that is) is configurable as an IP host then you can communicate with it through a standard sockets interface. If it already has some kind of interactive user interface, you may be able to simply attach to it with telnet. Ready-made tools such as netcat may also be useful.
If you want to attach to it programmatically, your easiest means will be to use IP sockets; either using TCP streams (SOCK_STREAM) or UPD datagrams (SOCK_DGRAM). If the target device does not have an IP stack, you will need to use raw datagrams (SOCK_RAW), and formulate your own packets to be sent as raw ethernet packets. Access at the SOCK_RAW level requires root privelages. The processs of formulating and parsing data at this level is probably much more difficult than the process of putting and getting the data to and from the wire.
From the tone of your question, it sounds like you are reluctant to attempt this level of programming, however it is not as difficult as you may think. A good primer on the subject is Beej's Guide to Network Programming Using Internet Sockets. Come back here with more specific questions if you get down this road. Good luck.
--- rod.


All times are GMT -5. The time now is 12:37 PM.