COM port - how to identify a device (.net/c#) -


I am programming for Windows CE and I need to connect to the scanner. There is no problem - I know this port is on COM0, but if I plug in another device then it gets another com port before it ... to get all the com ports easier:

  SerialPort.GetPortNames ()  

But I do not know how to identify a device? Is there any standard way? I can not 'ping' because there is a device that only sends data ... it spams data all the time ... and I do not know how to 'ping' a device ...

< / Div>

The problem of a serial connection is that is stateless you can not know that on the other hand Listening or who is listening.

You have a few options to find:

  • To know if
  • To know who is, you usually But you know any kind of message where you know the correct answer (for example a modem you send AT and you will get a OK .

So if you can not use any of the methods given above, you can not automatically detect which port of IS The only one working model is to ask the user about the correct settings (such as a combo box, available ports or bauders, checkboxes for different boolean configuration settings, etc.).


Comments