I have the same problem. But a little bit different. It looks like it
start to send something and it waits till it is send. Did you ever trie
to send someting and to tap a button, I know it doesn't react. But wait
for 5,10 seconds and tap several times and It sometimes exits. Also when
you do this and you put the Palm back in the cradle it reacts
immediately and closes the Port, at least my app does this. 


I think there a two potential problems 
The first is the CTS-timeout. make this one smaller
And the second even better one it SerSendWait(). This function waits
untill the data is send from the Buffer. The problem occurs when it's
not possible to send data. IT start to wait and wait and wait. When you
don't need to know if the data has been send. you can remove this
functions. Just trie it for once.

If it works, please tell me 

Patrick Heynen

>>> [EMAIL PROTECTED] 03/31/00 07:59AM >>>


I have a vague memory of seeing this - if I remember correctly, the
answer was
to call SerSendWait before the SerClose:

        SerSendWait(SerialRefNum, -1);
        SerClose(SerialRefNum);

- Al -



On Thu, 30 Mar 2000 12:40:25 -0500, you wrote:

>To all interested:
>
>Regarding the specifics of my SerClose problem
>(it hangs if using hardware handshake and
>nothing is plugged into the port).  I've stripped
>things down, and the code snippet below
>displays the problem ... it's essentially pulled
>straight from the online documentation.  Note
>that no errors are ever returned (my actual
>code tests 'em).
>
>// demonstration of my SerClose problem ....
>
>Err e;
>SerSettingsType sstSetup;
>extern UInt SerialRefNum;
>
>e= SerOpen(SerialRefNum,0,9600);
>e= SerGetSettings(SerialRefNum, &sstSetup );
>
>sstSetup.baudRate= 9600;
>sstSetup.flags=  serSettingsFlagBitsPerChar8 |
>                            serSettingsFlagStopBits1 |
>                            serSettingsFlagRTSAutoM |
>                            serSettingsFlagCTSAutoM;
>
>// NOTE: if the RTS and CTS flags are not ored in,
>// then there is no problem with SerClose
>
>sstSetup.ctsTimeout = (SysTicksPerSecond() / 2);
>
>e = SerSetSettings (SerialRefNum, &sstSetup);
>SerReceiveFlush (SerialRefNum, 100);
>
>// write something
>
>char buffer[]= "yippee, it works!";
>ULong bytesWritten= SerSend
>(SerialRefNum,(VoidPtr)buffer,StrLen(buffer),&e);
>SerReceiveFlush (SerialRefNum, 100);
>
>// changing settings here to have no hardware handshake
>// won't work since SerSetSettings appears to hang then!
>
>e = SerClose(SerialRefNum);  // HANGS ME OUT TO DRY!
>
>// alert never shows if something isn't plugged into the
>// port ... plug something in and "pop" the alert comes
>// up.
>
>FrmCustomAlert(JustAnAlert,"","","");
>
>
>Many thanks in advance to the kind soul who can crack this one.
>Folks in the field are bumming since they have to reset if they
>push the 'print' button when no printer is attached!
>
>[EMAIL PROTECTED] 

-- 
--  Alan Weiner  --  [EMAIL PROTECTED]  --  http://www.ajw.com 


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to