문제

I have a micro-controller (Arduino) and wish to determine automatically to which port the micro-controller locks to. The idea is not to have to correct the COM port manually for every app on every computer. Can this be done ? Thanks !

도움이 되었습니까?

해결책

Do you mean:

  • Micro-controller is an external hardware device
  • User plugs the device into a random serial port (COM port)
  • You want to know which COM port it's connected to

?

Also, you are talking about an old-style COM port, are you, not a USB?

Anyway if that is your question, the only way would be to:

  • Open each COM port on the machine and send data through it, to see (if the micro-controller sends back the expected resonse) whether it's talking to the expected device (e.g. if the device were a modem you might try sending "AT\r" and expect a modem to respond "OK", if there is a modem and if the modem is connected to that serial port).
  • And/or write a device driver or a service to do just this, instead of an application.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top