Selected2PlayerPort = sysFileCVirtIrComm;
err = SrmOpen(Selected2PlayerPort, 57600, &nSerPortId);
if (err == errNone)
{
Int16 paramSize;
Int32 baudRate = 57600;
UInt32 flags = srmSettingsFlagBitsPerChar8 |
srmSettingsFlagParityOnM | srmSettingsFlagParityEvenM |
srmSettingsFlagStopBits1 | srmSettingsFlagRTSAutoM;
Int32 ctsTimeout = SysTicksPerSecond();
paramSize = sizeof(baudRate);
err = SrmControl(nSerPortId, srmCtlSetBaudRate, &baudRate, ¶mSize);
paramSize = sizeof(flags);
err = SrmControl(nSerPortId, srmCtlSetFlags, &flags, ¶mSize);
paramSize = sizeof(ctsTimeout);
err = SrmControl(nSerPortId, srmCtlSetCtsTimeout, &ctsTimeout,
¶mSize);
bSerPortOpened = true;
}
works for me.
Regards
Henk
[EMAIL PROTECTED] wrote:
I am in the process of developing a Palm application to
communicate with an embedded device using the IrDA port.
As a first step, I am trying to get two Palms to talk with
each other. After failing at getting my example to work, I
have tried to modify the example "SerialChat" from the
"Palm OS Programming Bible" by changing the port it opened to
0x8001 (the IR port), which didn't work.
I then tried enabling IR communication with:
error=SrmControl(gPortID,srmCtlIrDAEnable,
(void *) &flags, &flagsSize);
and this doesn't work either.
I tried adding the following after openning the connection, as it
was suggested in one document I read as a way of establishing a
connection:
SrmSend(gPortID,buff,0,&error);
This also didn't work.
Although I have programmed in C/C++ for years, I am new to Palm
and IrDA and serial communications.
I would greatly appreciate any suggestions, and can provide more
details as needed.
If there is a simple application that has two Palms communicating
through the IR port using either the IR Library or the Serial
Manager, I would also like to see this. (I cannot use the
Exchange Manager because I think the chip which I will eventually
interface with does not support the protocols.)
Thanks,
Chuck.
--
-------------------------------------------------------------------------
Henk Jonas
Palm OS Â certified developer
[EMAIL PROTECTED] www.metaviewsoft.de
-------------------------------------------------------------------------
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/