Dek wrote:
My program send few bytes by irda raw.
Then must receive answer.
Answer may be varios from 41 to 84 bytes.
It is part of my program:
/*********************************
ticks = TimGetTicks() + 90;
do{
errp = SrmReceiveCheck( newPortId, &numOfBytes );
if (numOfBytes != 0)
{
if (numOfBytes > 84)
numOfBytes = 84;
SrmReceive (newPortId, &pkt[0], numOfBytes, 5, errp);
...
}while(TimGetTicks() < ticks );
/********************************
Case of receiving of 41 bytes.
It is work on zire 71, tungsten E. They receive 41 bytes.
Now run program on Zire 31. It receive 16, then 16, then 9 bytes.
Why it is? What to do?
Put your data into your own packet struct:
HEADER (defines some bytes which are kind of unique (0xdeadbeef :-)
LENGTH (send the data length you are expect to receive)
while (count < LENGTH)
receive more data
when you are checking, you check single bytes until you receive your
HEADER, then you grab the length and receive until you got LENGTH bytes.
Regards
Henk
--
-------------------------------------------------------------------------
Henk Jonas [EMAIL PROTECTED]
Palm OS ® certified developer
Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/