Added additional method needed for newer Zigbee lib versions
This commit is contained in:
parent
370fecaa8a
commit
fa78d02778
1 changed files with 14 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue