3cky / mbusd

Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.
BSD 3-Clause "New" or "Revised" License
565 stars 216 forks source link

Show an error when trying to use unsupported baudrate #63

Closed KrystianD closed 4 years ago

KrystianD commented 4 years ago

I had bad times trying to figure out why baudrate I use (500000) is not working with my device while it was working well with other modbus clients. With use of logic analyzer, it turned out mbusd used the default baudrate as 500000 was not supported. I think it would be worth to report an error to the user that he selected (via -s) an unsupported baudrate rather than silently revert to the default one (19200).

0 in ttyspeed is now treated as a marker of default baudrate which is then replaced with the default baudrate in tty_transpeed function. default clause just reports an error that unsupported baudrate was selected.

3cky commented 4 years ago

Thanks for PRs!

3cky commented 4 years ago

Also please note ad58141.