I'm working with the serial port. Here is what I did, may be there are
better ideas, but it works.


To open the serial port, I use the following functions:

SysLibFind (const Char* nameP, UInt16* refNumP); //Open library for serial
port, where
//nameP = "Serial Library"

SerOpen(UInt16 refNum, UInt16 port, UInt32 baud); //Open serial port

SerSetReceiveBuffer (UInt16 refNum, void *bufP, UInt16 bufSize); //Prepare
buffer that
//receives datas on queue

SerReceiveFlush (UInt16 refNum, Int32 timeout); //Flush datas on queues



Then, to read on the serial port:

SerReceiveCheck (UInt16 refNum, UInt32 *numBytesP); //Get number of bytes in
the receive
//queue

SerReceive (UInt16 refNum, void *bufP, UInt32 count, Int32 timeout, Err*
errP); //Returns                                        //number of bytes
worth of datas and if there are errors

SerReceiveFlush (UInt16 refNum, Int32 timeout); //Flush datas in the queue




So this is the functions I'm using, you can verify for errors. You could
also set a boolean to acknowledge when the serial port is opened and read
only if this is the case. I'M relatively new to Palm programming, so may be
someone will have a better idea.

Dominique Martel




-----Original Message-----
From: Christophe Gouwy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 2:41 AM
To: Palm Developer Forum
Subject: Use serial Port in a special way


Hello

I would like to know if someone has got information about the serial port
of PAlm

Moreover, i would like to know if it is possible to command individualy the
signals of the serial port (like on a PC: with RX,TX...)

Because I would like to plug a I2C system to my palm, so I have to create a
special protocol on the serial port of the palm.

Thank you for your help.






-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to