1

I'm creating a simple device that sends data to a Windows PC over serial COM ports.

I'd like the software to be able to scan the available COM ports until it recognizes the device. The problem is, if the PC tries to initiate the handshake with a device other than mine, it may interpret the commands [wrongly, of course].

The only solution I see is for my device to periodically broadcast some sort of identifier, perhaps 5 times per second or so, so the application only needs to listen for that identifier rather than risk corrupting another device also connected to a COM port. When the application loads, it listens on each available COM port until the device is recognised. Does this sound reasonable?

Thanks

Jodes
  • 14,118
  • 26
  • 97
  • 156
  • How many pins are you using? How fast is this device? How complex is this going to get. Short answer, sounds OK to me. – dbasnett Jul 01 '11 at 11:54
  • I'd be tempted to say that only one application could have a port open at a time, but I am aware that there is software that allows serial ports to be accessed from more than one program. That is why I asked about pins. – dbasnett Jul 01 '11 at 15:36

1 Answers1

1

IMO whatever the direction on which you initiate the handshake, the problem will be the same. If you send your handshake from your device and another application on your PC is listening to the corresponding serial port, it also has risks to badly interpret the data you are sending.

So I would say that software on both side should be protected against incoherent data they receive from the outside.

greydet
  • 5,509
  • 3
  • 31
  • 51