Menu

#1 Serial communication problem on Handspring Treo

open
nobody
None
5
2004-01-20
2004-01-20
Anonymous
No

On handspring treo the software can't open serial port
because a programming manual paragraph :

5.1. HotsyncŽ and Keyboards
Hotsync is a special case. The library that Hotsync
uses has been modified so that both USB and serial
communications are supported automatically. The serial
cradle for the Handspring Visor grounds a pin labeled
KBD* on the cradle port (the asterisk denotes an active
low signal). This signal indicates to the operating system
that it is in a serial cradle. If KBD* is asserted,
Hotsync will use the “Serial Library”, which can be
redirected
via HsPrefSet() to a Springboard module, if necessary.
If KBD* is not asserted, HotSync will use the
“USB Library.”
Additionally, when Visor is placed into a serial cradle
a daemon is automatically launched to support keyboard
input. This process opens the “BuiltIn SerLib” and
waits for specially formatted packet data on the Rx pin
(representing keyboard input). At this point, if an
application were to open a serial port library again,
an error
would return indicating that the port is already in use.
The workaround for this error is to disable the
keyboard process via software:
Example:
#include <HsExt.h>
// If on Handspring device, disable the keyboard
// thread before opening the serial library.
if (!FtrGet ('hsEx', 0, &ftrHSVersion))
HsExtKeyboardEnable (false);
(continue with SysLibFind(), SerOpen(), etc)
// Note that there is no need to re-enable the keyboard
support. // It is
automatically re-enabled each time it is placed into
the // cradle.
For development purposes, soft-resetting the Visor in
the serial cradle will also result in disabling the
keyboard
daemon. That is because it is launched when the device
is inserted into the cradle, but is not re-started
until Visor
is removed and re-inserted into the serial cradle.

Discussion


Log in to post a comment.