本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer
类的一些代码示例,展示了ZclFieldDeserializer
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclFieldDeserializer
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer
类名称:ZclFieldDeserializer
[英]ZCL field deserializer.
[中]ZCL字段反序列化器。
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
armMode = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
armDisarmCode = (String) deserializer.deserialize(ZclDataType.CHARACTER_STRING);
zoneId = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
if (deserializer.getRemainingLength() == 1) {
status = (ZclStatus) deserializer.deserialize(ZclDataType.ZCL_STATUS);
return;
}
attributeSelectors = (Object) deserializer.deserialize(ZclDataType.N_X_ATTRIBUTE_SELECTOR);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
return;
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
super.deserialize(deserializer);
// Create lists
nwkAddrAssocDevList = new ArrayList<Integer>();
status = (ZdoStatus) deserializer.deserialize(ZclDataType.ZDO_STATUS);
if (status != ZdoStatus.SUCCESS) {
// Don't read the full response if we have an error
return;
}
ieeeAddrRemoteDev = (IeeeAddress) deserializer.deserialize(ZclDataType.IEEE_ADDRESS);
nwkAddrRemoteDev = (Integer) deserializer.deserialize(ZclDataType.NWK_ADDRESS);
if (deserializer.isEndOfStream()) {
return;
}
Integer numAssocDev = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
startIndex = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
if (numAssocDev != null) {
for (int cnt = 0; cnt < numAssocDev; cnt++) {
nwkAddrAssocDevList.add((Integer) deserializer.deserialize(ZclDataType.NWK_ADDRESS));
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void test() {
int[] packet = getPacketData("09 7B 00 24 00 00 00 00 00");
ZoneStatusChangeNotificationCommand command = new ZoneStatusChangeNotificationCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0x500), command.getClusterId());
assertEquals(Integer.valueOf(36), command.getZoneStatus());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void deserialize() {
int[] packet = getPacketData("01 12 40 00 00");
OffWithEffectCommand command = new OffWithEffectCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0), command.getEffectIdentifier());
assertEquals(Integer.valueOf(0), command.getEffectVariant());
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
power = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
pathLossExponent = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
calculationPeriod = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
numberRssiMeasurements = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
reportingPeriod = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
if (deserializer.getRemainingLength() == 1) {
status = (ZclStatus) deserializer.deserialize(ZclDataType.ZCL_STATUS);
return;
}
records = (List<AttributeStatusRecord>) deserializer.deserialize(ZclDataType.N_X_ATTRIBUTE_STATUS_RECORD);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testReceiveNull() {
int[] packet = getPacketData("01 00 86");
ReadAttributesResponse response = new ReadAttributesResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
response.deserialize(fieldDeserializer);
System.out.println(response);
List<ReadAttributeStatusRecord> records = response.getRecords();
ReadAttributeStatusRecord record = records.get(0);
assertEquals(ZclStatus.UNSUPPORTED_ATTRIBUTE, record.getStatus());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
startCommandIdentifier = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
maximumCommandIdentifiers = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
if (deserializer.getRemainingLength() == 1) {
status = (ZclStatus) deserializer.deserialize(ZclDataType.ZCL_STATUS);
return;
}
records = (List<WriteAttributeStatusRecord>) deserializer.deserialize(ZclDataType.N_X_WRITE_ATTRIBUTE_STATUS_RECORD);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void test() {
int[] packet = getPacketData("09 63 01 0D 00 4E 10");
ZoneEnrollRequestCommand command = new ZoneEnrollRequestCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0x500), command.getClusterId());
assertEquals(Integer.valueOf(13), command.getZoneType());
assertEquals(Integer.valueOf(4174), command.getManufacturerCode());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
numberOfTransitions = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
dayOfWeek = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
mode = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
transition = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
heatSet = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
coolSet = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testReceiveHwVersion() {
int[] packet = getPacketData("01 0C 11 62 00 03 05 02 01 33 44");
QueryNextImageCommand command = new QueryNextImageCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(4364), command.getManufacturerCode());
assertEquals(Integer.valueOf(98), command.getImageType());
assertEquals(Integer.valueOf(0x1020503), command.getFileVersion());
assertEquals(Integer.valueOf(0x4433), command.getHardwareVersion());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
zoneType = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_16_BIT);
manufacturerCode = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testReceive() {
int[] packet = getPacketData("2E FD FF 04 01 00 01 00 05");
MatchDescriptorRequest request = new MatchDescriptorRequest();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
request.deserialize(fieldDeserializer);
System.out.println(request);
assertEquals(Integer.valueOf(65533), request.getNwkAddrOfInterest());
assertEquals(Integer.valueOf(260), request.getProfileId());
assertEquals(0, request.getInClusterList().size());
assertEquals(1, request.getOutClusterList().size());
assertEquals(Integer.valueOf(1280), request.getOutClusterList().get(0));
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
coordinate1 = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
coordinate2 = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
coordinate3 = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
power = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
pathLossExponent = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testReceive() {
int[] packet = getPacketData("01");
DiscoverCommandsGeneratedResponse response = new DiscoverCommandsGeneratedResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
response.deserialize(fieldDeserializer);
System.out.println(response);
assertNull(response.getCommandIdentifiers());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZclFieldDeserializer deserializer) {
status = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
groupId = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
sceneId = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
transitionTime = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
sceneName = (String) deserializer.deserialize(ZclDataType.CHARACTER_STRING);
extensionFieldSets = (List<ExtensionFieldSet>) deserializer.deserialize(ZclDataType.N_X_EXTENSION_FIELD_SET);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testReceive() {
int[] packet = getPacketData("00 0C 11 62 00 03 05 02 01");
QueryNextImageCommand command = new QueryNextImageCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(4364), command.getManufacturerCode());
assertEquals(Integer.valueOf(98), command.getImageType());
assertEquals(Integer.valueOf(0x1020503), command.getFileVersion());
assertNull(command.getHardwareVersion());
}
内容来源于网络,如有侵权,请联系作者删除!