Hi again
My RS232 works on the emulator when redirecting the palm serial to PC COM1
port
I open the port using : serPortCradlePort
but I tried serPortIrPort, nothing with the palm and the same with the
Emulator (ie it directs all serials to COM1)
I don't have a serial cable to connect to Palm to see if it work
(any addy for a place which sells m125 universal connectors on Europe/France
?)
but with IR, Isee nothing :-(
Thanks for any info.
here is the code if it interests someone :-)
I open it like this :
-------------------------------
Boolean handled = false;
FormType * frmP;
ControlType * ctlP;
UInt16 paramSize;
UInt32 flags = srmSettingsFlagBitsPerChar8 |
srmSettingsFlagParityOnM | srmSettingsFlagParityEvenM |
srmSettingsFlagStopBits1;
// | srmSettingsFlagRTSAutoM | srmSettingsFlagCTSAutoM;
serPortOpened = false;
err = SrmOpen( serPortCradlePort , 9600, &portId);
// serPortCradlePort ou serPortCradleRS232Port ou serPortIrPort
if (err!=errNone) {
FrmAlert (Err_open_serialAlert);
}
//record our open status in global.
serPortOpened = true;
paramSize = sizeof(flags);
err = SrmControl( portId, srmCtlSetFlags, &flags, ¶mSize);
if (err!=errNone) {
FrmAlert (Err_open_serialAlert);
}
MainFormInit(frmP);
FrmDrawForm(frmP);
handled = true;
break;
//and close it like this :
-------------------------
case frmCloseEvent:
if (serPortOpened) {
err = SrmClose ( portId);
if (err!=errNone) {
FrmAlert (Err_close_serialAlert);
}
//record our open status in global.
serPortOpened = false;
}
handled = false;
break;
.............
the remaining is classic
I send the 3 char like this :
--------------------------------
void UpdateAffichage()
{
FormType * frmP;
ControlType * ctlP;
// FieldType *fldP;
UInt32 numSent;
unsigned int vit_bin;
char out[4];
out[3]=0; // fin de la séquence
frmP = FrmGetActiveForm();
if (serPortOpened) {
// I send the 3 char !!!
vit_bin=Vitesse;
out[0]='1';
out[1]=vit_bin & 255;
out[2]=vit_bin /256;
numSent = SrmSend(portId, out, 4, &err);
if (err == serErrTimeOut) {
//cts timeout detected
FrmAlert (Err_send_serialAlert);
}
}
}