use of me.retrodaredevil.io.serial.SerialConfig in project solarthing by wildmountainfarms.
the class SerialIOConfig method createIOBundle.
@Override
public IOBundle createIOBundle() throws Exception {
SerialConfig serialConfig = this.serialConfig;
if (serialConfig == null) {
serialConfig = defaultSerialConfig;
if (serialConfig == null) {
throw new NullPointerException("serialConfig is null! This is likely because the injection didn't work properly.");
}
}
String port = this.port;
if (port == null) {
throw new NullPointerException("null is not a valid value for the port!");
}
SerialPort serialPort = JSerialIOBundle.createSerialPortFromName(port);
return new JSerialIOBundle(serialPort, serialConfig, new JSerialIOBundle.Config(200, 65536, 65536));
}
Aggregations