use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacketStream in project com.zsmartsystems.zigbee by zsmartsystems.
the class Cc2351TestPacket method getPacket.
protected ZToolPacket getPacket(String stringData) {
int[] packet = getPacketData(stringData);
byte[] byteArray = new byte[packet.length - 1];
for (int c = 1; c < packet.length; c++) {
byteArray[c - 1] = (byte) packet[c];
}
ByteArrayInputStream stream = new ByteArrayInputStream(byteArray);
ZigBeePort port = new TestPort(stream, null);
try {
ZToolPacket ztoolPacket = new ZToolPacketStream(port).parsePacket();
assertFalse(ztoolPacket.isError());
return ztoolPacket;
} catch (IOException e) {
return null;
}
}
Aggregations