@Override public void setValue(Value value) { arr = value.getByteArrayValue(); }
/** * The value has to be a ByteArrayValue in reversed byte order */ @Override public void writeValue(Connection connection, Value value) throws IOException { byte[] messagePayload = value.getByteArrayValue(); if (messagePayload == null) messagePayload = emptyMessagePayload; connection.localDevice.sendMessage(clusterCommand.getMessage(messagePayload)); }
/** * The value has to be a ByteArrayValue in Little Endian Byte order */ @Override public void writeValue(Connection connection, Value value) throws IOException, UnsupportedOperationException { if (multipleAttributes) { throw new UnsupportedOperationException(); // TODO implement this // method } else { if (clusterAttribute.readOnly() || !(value instanceof ByteArrayValue)) throw new UnsupportedOperationException(); byte[] messagePayload = value.getByteArrayValue(); if (messagePayload == null) messagePayload = emptyMessagePayload; synchronized (channelLock) { connection.localDevice.sendRequestMessage(clusterAttribute.getMessage((byte) 0x02, messagePayload), Constants.WRITE_ATTRIBUTES_RESPONSE, channelLock); try { channelLock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
@Override public void writeValue(Connection connection, Value value) throws IOException, UnsupportedOperationException { if (isAttribute) { if (clusterAttribute.readOnly() || !(value instanceof ByteArrayValue)) throw new UnsupportedOperationException(); byte[] messagePayload = value.getByteArrayValue(); if (messagePayload == null) messagePayload = emptyMessagePayload; synchronized (channelLock) { connection.localDevice.sendRequestMessage(cluster.getManufacturerSpecificAttributeMessage((byte) 0x02, manufacturerId, attributeId, messagePayload), Constants.WRITE_ATTRIBUTES_RESPONSE, channelLock); try { channelLock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } else { byte[] messagePayload = value.getByteArrayValue(); if (messagePayload == null) messagePayload = emptyMessagePayload; connection.localDevice.sendMessage(cluster.getManufacturerSpecificCommandMessage(manufacturerId, commandId, messagePayload)); } }
/** * Use this method to send transmit request frames. The payload passed as byte array value will be built into frames * by the FrameFactory and then sent. */ @Override public void writeValue(Connection connection, Value value) throws IOException, UnsupportedOperationException { TransmitRequest transmitRequest = new TransmitRequest(xBeeDevice.getAddress64Bit(), xBeeDevice .getAddress16Bit(), value.getByteArrayValue()); connection.localDevice.sendMessage(transmitRequest); }
case BYTE: manager.setValueAsByte(valueid, value.getByteArrayValue()[0]); break; case DECIMAL: throw new UnsupportedOperationException(); case RAW: manager.setValueAsRaw(valueid, value.getByteArrayValue()); default: throw new UnsupportedOperationException();
logger.debug(Converter.toHexString(value.getByteArrayValue()));