socket programming for mpc8313e rdb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

socket programming for mpc8313e rdb

1,792 Views
jprice
Contributor I
Hi I just recieved an mcp8313e rdb w/LTIB and cw ide 5.9.0 for my laptop runnig windows xp.  I have built and run the sample program, used the debugger all worked fine.  Now I want to do some socket programming and haven't got a clue how to get started.  Any pointers to source code samples or documentation would be greatly appreciated.
 
thanks
Tags (1)
0 Kudos
Reply
2 Replies

719 Views
jprice
Contributor I
Thanks abartky,  now that I made some progress I am able to more accurately state my problem.  As stated earlier I'm new to code warrior and I find it cumbersome to deal with right now trying to build my application.
 
My initial problem was setting the access path to find the header files for my application, such as <netinet/in.h>...
 
Now I get my program to compile but need to find the library with calls to socket(), htons(), ...  probably the same process find the libraries and set the path.
 
I would be interested in seeing your program that writes to a raw socket on the mcp8313rdb.
 
thanks
0 Kudos
Reply

719 Views
abartky
Contributor IV

jprice,

 

As far as programming sockets goes on the MPC8313E-RDB under LTIB, it looks like you have a good head start in that you have your environment up and running and are able to compile a test program.

 

Getting sockets working is pretty straightforward and I can vouch for the fact that I have both IPv4/UDP and raw packet sockets working just fine for my IEEE 1588 PTP project. Although I've not done any direct work with IPv4/TCP sockets, I am sure they should drop in just fine.

 

For my project I ported the IEEE 1588 Precision Time Protocol daemon code (ptpd) at sourceforge.net. If you download that code, there is a good example of IPv4/UDP socket handling and the code is also abstracted pretty well to function calls like netInit, netSendEvent, etc. You can find that code at:

 

http://www.security-freak.net/sockets/socket-programming.html

 

If you've never programmed in sockets before, then one site that helped me learn the basics was at:

 

http://www.security-freak.net/sockets/socket-programming.html

 

This is a cool site in that there is not just sample code for raw sockets, but also some video tutorials that walk you through the process of coding and testing some simple socket programs.

 

Anyway, hopefully this helps. I can also send you some sample code if you'd like that I actually have running on my MPC8313E-RDB board. You can drop me an email by my Freescale alias "abartky" or you can also find my contact info at my web site.

 

Cheers,

abartky

http://www.bartky.net

 

0 Kudos
Reply