c# serialport question -


I have a computer connected to my computer

How do I get along with serial port Find out who on COM?

Explode all COM ports and try to get recognition from each one is a minimal example below Better error checking etc. should be expanded.

  string [] sports = SerialPort.GetPortNames (); Foreach (strings port in esports) {var serial port = new serial port (); SerialPort.PortName = Port; SerialPort.Open (); SerialPort.WriteLine ("ATI"); // This port asks you to issue a similar string that you can match against var message = Console.ReadLine (); // Read Feedback}  

You may be able to use Win32_SerialPort and Win32_PnPEntity as well as WMI. I have not tried to see what information he gives back.


Comments

Post a Comment

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -