Page 1 of 1

PostPosted: Tue Feb 18, 2003 3:56 am
by drewg
Hi,

I'm currently writing a program in PocketC in Windows CE
for Handheld PC, Professional Edition. The device is a
Compaq Aero 8000. Processor: Hitachi SuperH (SH-4).

This program requires sending and receiving data through
the serial port, however, the Handheld device can send data
to the serial port, but it only receives the first two
character of the response from the serial port.

Communications are set to 9600 baud, 8 bits/char, no parity,
and 1 stop bit, using the following command:

ret = seropen(9600,"8N1N",1000);

The code is set to produce an event when it receives a
character, using the following function:

commsetmask(ret,EV_RXCHAR);

Where "ret" is the handle to the serial port.

The code waits for an RX char event using the following
code:

while(!finished) {
commwait(ret,0);
wind_event=event(1);

switch(wind_event) {
case PM_COMMEVENT:

do {
cc=readbyte(ret);
in[count] = cc;

count++;
if (count>=6)
finished = TRUE;

} while (serdata() == TRUE && !finished)

break;
}
}

I'm using PocketC version 3.01 for Windows CE, Handheld
PC, Professional Edition.

All the best,
Andrew Gregory