NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
345 stars 143 forks source link

Factories to create SerialPort instance. #82

Closed msteigenberger closed 5 years ago

msteigenberger commented 8 years ago

If client has to struggle with different SerialPort implementations (i.e. RxTxPort and TelnetSerialPort), it's easier to use a factory which automatically decides which SerialPort implementation to use depending on the port name. Therefore for the TelnetSerialPort an rfc2217:// URL has to be used. This also reduces dependencies on client side code when using TelnetSerialPort. Incorporated changes suggested in PR #77 (NRSerialPort behaviour left unchanged, means it can just handle a RxTxPort and no TelnetSerialPort).