From: Demetris Z. <fgc...@cy...> - 2007-06-25 14:40:18
|
Tnx Dave. I really appreciate the help -----Original Message----- From: gum...@li... [mailto:gum...@li...] On Behalf Of Dave Hylands Sent: Monday, June 25, 2007 5:33 PM To: General mailing list for gumstix users. Subject: Re: [Gumstix-users] Serial Code Question HI Demtris, > Let's say I want to send 3 different things thorugh the serial. > > "Init", "1","3" ("1","3") are bytes > > I have the Atmega waiting for the "Init" and only after it has received > "Init" it will receive the other two bytes. So how do I send this with one > transmission ? There is no such thing as "one transmission" in serial. You can do: write( fd, "Init", 4 ); write( fd, "1", 1 ); write( fd, "3", 1 ); or you could do write( fd, "Init13", 6 ); The receiver can't tell how you did it. If you use interrupt driven UART code with a FIFO on the ATMega, then you won't have to worry about missing any characters either. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ gumstix-users mailing list gum...@li... https://lists.sourceforge.net/lists/listinfo/gumstix-users |