I am writing an application that communicates (via a serial port) with an electronic device that I developed myself.
When the PC application starts, it opens the available COM ports one by one and sends a certain line (for example, what are you?).
My device is programmed to answer this "magic question" with its own identifier (for example: "I am an evil device for monitoring employees").
When my PC software receives this โmagic answerโ, it starts working fine and no longer searches for other ports.
Of course, I do not use silly questions in data transfer, this is just an example.
Question: can I send lines, for example, to all (not busy) ports to open my device?
If I can - what should this question line look like? Are there normalized standards?
This is not the first such project on my desk, but now I am developing a solution for a small industry, and I need to pay more attention to what my application does, because there may be other devices connected to COM ports, and I donโt know how they are can react.
I'm sorry if I made some language mistakes, English is my third language.
Thanks for answers.
Kamil source share