none
WinCE 6.0 - USBSER_Class and cable removal RRS feed

  • Question

  • Hello,

    I have gotten a WinCE6.0 device to show up as a virtual serial port on WindowsXP by setting the HKLM\Drivers\USB\FunctionDrivers entry "DefaultClientDriver"="USBSER_Class", changing the VID an PID in the USBSER_Class to match the VID and PID in a sample .inf file from lvr.com that links that VID/PID to XP's UsbSer.sys. This creates a virtual comport connection over the USB cable between the WinCE device and the XP computer. (I am just using this VID/PID for my testing and will change them in the future.)

    I am able to connect on both sides using serial port components, but I was wondering if there is a  way to tell if the USB link is broken? If I do not set the serial port write timeout, the program will hang if the USB cable is removed. The serial port write timout will allow the program to continue even if the link is broken, but I was hoping for something a little more definitive that would let me know that the connection was lost. Is there anything I could check?

    (VS2005, NetCFV2.0, WinCE6.00)

    Thank you.


    Wednesday, March 7, 2012 10:28 PM

Answers

  • You will need some hardware that detects the cable disconnect.  Typically this is done by detecting the loss of the 5v line and signalling an interupt.

    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com

    • Marked as answer by Jerry Bastain Thursday, March 8, 2012 4:08 PM
    Thursday, March 8, 2012 1:30 PM
    Moderator

All replies

  • You will need some hardware that detects the cable disconnect.  Typically this is done by detecting the loss of the 5v line and signalling an interupt.

    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com

    • Marked as answer by Jerry Bastain Thursday, March 8, 2012 4:08 PM
    Thursday, March 8, 2012 1:30 PM
    Moderator
  • Bruce,

    In hindsight, it seems so obvious.

    Thank you.

    Thursday, March 8, 2012 3:58 PM