No break event on serial port (Pocket PC 2003)

  • Thread starter Thread starter Dries Naudts
  • Start date Start date
D

Dries Naudts

Dear all,

i'm having an issue while connecting a Pocket PC to a PC through the
serial interface. I'm implementing code in C#. When i set the SerialPort
breakstate = true, I do not receive a PinChanged (BreakEvent) on the
serial port of the Pocket PC. I do receive other PinChanged events (eg
CtsChanged, CDChanged, ...) However, when I connect two PC's it works fine.

Actually, I want to connect a certain device to the Pocket PC through
the serial port. This device generates a Break event, which I need to
catch. I'm using the Compact Framework 2.0, which imho supports
SerialPort objects.

Has anyone had similar problems or has an answer to this problem?

Regards,
Dries Naudts

Code:

PC:
prt.BreakState = true;

PocketPC
// pin changed on serial port (device woke up)
void prt_PinChanged(object sender, SerialPinChangedEventArgs e)
{
switch (e.EventType)
{
case SerialPinChange.Break:
if (!bRadio_Awake)
{
bRadio_Awake = true;
prt.RtsEnable = true;
System.Threading.Thread.Sleep(50);
prt.RtsEnable = false;

System.Threading.Thread.Sleep(10);
....
 
Have you tested this on multiple devices (i.e. different OEMS)? Since a
break is simply space voltage for a long period of time (> 0.25s IIRC) and
many UARTS provide an interrupt specifically for it, then the lack of it
implies that the OEM's driver may not have provided support for it.

The other option to verify is to P/Invoke to see if the lower-level API sees
the break. You might try the older OpenNETCF serial library - I know I
didn't test the break condition, but I may have coded for it.

www.opennetcf.org/serial


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Thank you very much for your answer.

Doing some googling and further testing, i found a solution. When the
UART cannot detect a break signal, the frame error can be used to
identify breaks!

(cfr.
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/serial-uart/index.html
section 1.4.2 ---
Most UARTs can distinguish between a Framing Error and a Break, but if
the UART cannot do this, the Framing Error detection can be used to
identify Breaks.)

Regards,
Dries
 
Back
Top