Added additional method needed for newer Zigbee lib versions

This commit is contained in:
Ziver Koc 2021-12-03 01:52:09 +01:00
parent 370fecaa8a
commit fa78d02778

View file

@ -26,6 +26,7 @@ package se.hal.plugin.zigbee;
import com.fazecast.jSerialComm.SerialPort;
import com.zsmartsystems.zigbee.transport.ZigBeePort;
import com.zsmartsystems.zigbee.zcl.field.ByteArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -192,6 +193,19 @@ public class ZigBeeJSerialCommPort implements ZigBeePort {
}
}
//@Override
public void write(int[] bytes) {
if (serialOutputStream == null)
throw new RuntimeException("Unable to write, Serial port is not open.");
try {
ByteArray arr = new ByteArray(bytes);
serialOutputStream.write(arr.get());
} catch (IOException e) {
logger.error("Was unable to write byte array to serial port.", e);
}
}
@Override
public int read() {
return read(0);