Sorry i mised out....
Here is the problem .....

I am able to recieve data first time.
Next time when this handler function is invoked it hangs at
SrmReceiveWindowOpen(openPort, &bufP, &count); call and after some
time palm device resets.

Can some body tell me what is the problem with this code.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Nathan Black
Sent: Tuesday, June 29, 2004 10:38 AM
To: Palm Developer Forum
Subject: RE: Usb...Urgent Please


it helps if you actually ask a question

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:bounce-palm-
[EMAIL PROTECTED] Behalf Of Ritu Chawla
Sent: Monday, June 28, 2004 11:13 PM
To: Palm Developer Forum
Subject: Usb...Urgent Please


We are using wakeup handler function for recieving data from USB port.

Sample code is as follows

error = SrmExtOpen(serPortCradleUSBPort, &config, sizeof(config),&openPort);

if (!error)

{

error =

SrmSetWakeupHandler(openPort,(WakeupHandlerProcPtr)RecvEventHandler,

(UInt32)openPort);

error = SrmPrimeWakeupHandler (openPort, 1);

}



In handler function we have written following code

static void RecvEventHandler(UInt32 refCon)

{

Err error = 0;

char buf[4];

UInt32 count = 0;

Err err = 0;

UInt8* bufP;

while (true) {

//read the data

err = SrmReceiveWindowOpen(openPort, &bufP, &count);

if (err)

SrmClearErr(openPort);

if (!count)

{

break;

}

if (bufP)

{

//Process the data here.

}

//Let the New Serial Manager know that we're done with the data.

SrmReceiveWindowClose(openPort, count);

}



--
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/


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

Reply via email to