- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.zcl.protocol.ZclDataType
类的一些代码示例,展示了ZclDataType
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclDataType
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.protocol.ZclDataType
类名称:ZclDataType
暂无
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
attributeDataType = ZclDataType.getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
attributeValue = deserializer.readZigBeeType(attributeDataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void serialize(final ZigBeeSerializer serializer) {
serializer.appendZigBeeType(attributeIdentifier, ZclDataType.UNSIGNED_16_BIT_INTEGER);
serializer.appendZigBeeType(attributeDataType.getId(), ZclDataType.UNSIGNED_8_BIT_INTEGER);
serializer.appendZigBeeType(attributeValue, attributeDataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Deserializes a field.
*
* @param dataType the {@link ZclDataType} of the field.
* @return the value
*/
public Object deserialize(final ZclDataType dataType) {
if (ZclListItemField.class.isAssignableFrom(dataType.getDataClass())) {
final Class<?> dataTypeClass = dataType.getDataClass();
final List<ZclListItemField> list = new ArrayList<ZclListItemField>();
try {
while (deserializer.getSize() - deserializer.getPosition() > 0) {
final ZclListItemField item;
try {
item = (ZclListItemField) dataTypeClass.newInstance();
} catch (final Exception e) {
throw new IllegalArgumentException("Error deserializing field: " + dataType.getLabel(), e);
}
item.deserialize(this.deserializer);
list.add(item);
}
} catch (ArrayIndexOutOfBoundsException e) {
// Eat the exception - this terminates the list!
}
return list;
}
return deserializer.readZigBeeType(dataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
break;
case ZIGBEE_DATA_TYPE:
value[0] = ZclDataType.getType(payload[index++]);
break;
case BYTE_ARRAY:
default:
throw new IllegalArgumentException("No reader defined in " + ZigBeeDeserializer.class.getSimpleName()
+ " for " + type.toString() + " (" + type.getId() + ")");
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
direction = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER);
attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
if (direction == 1) {
// If direction is set to 0x01, then the timeout period field is included in the payload,
// and the attribute data type field, the minimum reporting interval field, the
// maximum reporting interval field and the reportable change field are omitted. The
// record is sent to a cluster client (or server) to configure how it should expect
// reports from a server (or client) of the same cluster.
timeoutPeriod = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
} else {
// If direction is set to 0x00, then the attribute data type field, the minimum
// reporting interval field, the maximum reporting interval field and the reportable
// change field are included in the payload, and the timeout period field is omitted.
// The record is sent to a cluster server (or client) to configure how it sends reports to
// a client (or server) of the same cluster.
attributeDataType = ZclDataType
.getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
minimumReportingInterval = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
maximumReportingInterval = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
if (attributeDataType.isAnalog()) {
// The reportable change field shall contain the minimum change to the attribute that
// will result in a report being issued. This field is of variable length. For attributes
// with 'analog' data typethe field has the same data type as the attribute. The sign (if any) of the
// reportable change field is ignored. For attributes of 'discrete' data type this field is omitted.
reportableChange = deserializer.readZigBeeType(attributeDataType);
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void serialize(final ZigBeeSerializer serializer) {
serializer.appendZigBeeType(direction, ZclDataType.UNSIGNED_8_BIT_INTEGER);
serializer.appendZigBeeType(attributeIdentifier, ZclDataType.UNSIGNED_16_BIT_INTEGER);
if (direction == 1) {
// If direction is set to 0x01, then the timeout period field is included in the payload,
// and the attribute data type field, the minimum reporting interval field, the
// maximum reporting interval field and the reportable change field are omitted. The
// record is sent to a cluster client (or server) to configure how it should expect
// reports from a server (or client) of the same cluster.
serializer.appendZigBeeType(timeoutPeriod, ZclDataType.UNSIGNED_16_BIT_INTEGER);
} else {
// If direction is set to 0x00, then the attribute data type field, the minimum
// reporting interval field, the maximum reporting interval field and the reportable
// change field are included in the payload, and the timeout period field is omitted.
// The record is sent to a cluster server (or client) to configure how it sends reports to
// a client (or server) of the same cluster.
serializer.appendZigBeeType(attributeDataType.getId(), ZclDataType.UNSIGNED_8_BIT_INTEGER);
serializer.appendZigBeeType(minimumReportingInterval, ZclDataType.UNSIGNED_16_BIT_INTEGER);
serializer.appendZigBeeType(maximumReportingInterval, ZclDataType.UNSIGNED_16_BIT_INTEGER);
// The reportable change field shall contain the minimum change to the attribute that
// will result in a report being issued. This field is of variable length. For attributes
// with 'analog' data typethe field has the same data type as the attribute. The sign (if any) of the
// reportable change field is ignored. For attributes of 'discrete' data type this field is omitted.
if (attributeDataType.isAnalog()) {
serializer.appendZigBeeType(reportableChange, attributeDataType);
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
buffer[length++] = ((ZclDataType) data).getId();
break;
default:
throw new IllegalArgumentException("No writer defined in " + ZigBeeDeserializer.class.getSimpleName()
+ " for " + type.toString() + " (" + type.getId() + ")");
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public String toString() {
StringBuilder builder = new StringBuilder(220);
builder.append("AttributeReportingConfigurationRecord: [attributeDataType=");
builder.append(attributeDataType);
builder.append(", attributeIdentifier=");
builder.append(attributeIdentifier);
builder.append(", direction=");
builder.append(direction);
if (direction == 0) {
builder.append(", minimumReportingInterval=");
builder.append(minimumReportingInterval);
builder.append(", maximumReportingInterval=");
builder.append(maximumReportingInterval);
if (attributeDataType.isAnalog()) {
builder.append(", reportableChange=");
builder.append(reportableChange);
}
} else if (direction == 1) {
builder.append(", timeoutPeriod=");
builder.append(timeoutPeriod);
}
builder.append(']');
return builder.toString();
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getLabel() {
ZclDataType type = ZclDataType.BOOLEAN;
assertEquals("Boolean", type.getLabel());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Serializes field value.
*
* @param value the field value
* @param dataType the data type
*/
public void serialize(final Object value, final ZclDataType dataType) {
if (ZclListItemField.class.isAssignableFrom(dataType.getDataClass())) {
final List<ZclListItemField> list = (List<ZclListItemField>) value;
for (final ZclListItemField item : list) {
item.serialize(serializer);
}
return;
}
serializer.appendZigBeeType(value, dataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void isAnalog() {
ZclDataType type = ZclDataType.BOOLEAN;
assertFalse(type.isAnalog());
type = ZclDataType.UNSIGNED_16_BIT_INTEGER;
assertTrue(type.isAnalog());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
attributeDataType = ZclDataType.getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
attributeValue = deserializer.readZigBeeType(attributeDataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void serialize(final ZigBeeSerializer serializer) {
serializer.appendZigBeeType(attributeIdentifier, ZclDataType.UNSIGNED_16_BIT_INTEGER);
serializer.appendZigBeeType(attributeDataType.getId(), ZclDataType.UNSIGNED_8_BIT_INTEGER);
serializer.appendZigBeeType(attributeValue, attributeDataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getType() {
assertEquals(ZclDataType.BOOLEAN, ZclDataType.getType(0x10));
assertEquals(ZclDataType.CHARACTER_STRING, ZclDataType.getType(0x42));
assertEquals(ZclDataType.DATA_8_BIT, ZclDataType.getType(0x08));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getId() {
assertEquals(0x10, ZclDataType.BOOLEAN.getId());
assertEquals(0x42, ZclDataType.CHARACTER_STRING.getId());
assertEquals(0x08, ZclDataType.DATA_8_BIT.getId());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
status = (ZclStatus) deserializer.readZigBeeType(ZclDataType.ZCL_STATUS);
if (status.equals(ZclStatus.SUCCESS)) {
attributeDataType = ZclDataType
.getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
attributeValue = deserializer.readZigBeeType(attributeDataType);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void serialize(final ZigBeeSerializer serializer) {
serializer.appendZigBeeType((short) attributeIdentifier, ZclDataType.UNSIGNED_16_BIT_INTEGER);
serializer.appendZigBeeType(status, ZclDataType.ZCL_STATUS);
serializer.appendZigBeeType((byte) attributeDataType.getId(), ZclDataType.UNSIGNED_8_BIT_INTEGER);
serializer.appendZigBeeType(attributeValue, attributeDataType);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testDeserialize_ZIGBEE_DATA_TYPE() {
int[] valIn = { 33 };
ZclDataType valOut = ZclDataType.getType(valIn[0]);
testDeserialize(valIn, valOut, ZclDataType.ZIGBEE_DATA_TYPE);
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
return;
ZclDataType dataType = ZclDataType.getType(dataTypeId);
if (dataType == null) {
logger.debug("{}: Data type {} not found", node.getIeeeAddress(), dataType);
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeApsFrame类的一些代码示例,展示了ZigBeeApsFrame类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpointAddress类的一些代码示例,展示了ZigBeeEndpointAddress类的具体用法。这些代码
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeChannel类的一些代码示例,展示了ZigBeeChannel类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkManager类的一些代码示例,展示了ZigBeeNetworkManager类的具体用法。这些代码示例
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint类的一些代码示例,展示了ZigBeeEndpoint类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode类的一些代码示例,展示了ZigBeeNode类的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeProfileType类的一些代码示例,展示了ZigBeeProfileType类的具体用法。这些代码示例主要来源于G
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeAddress类的一些代码示例,展示了ZigBeeAddress类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeGroupAddress类的一些代码示例,展示了ZigBeeGroupAddress类的具体用法。这些代码示例主要来源
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeCommand类的一些代码示例,展示了ZigBeeCommand类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkNodeListener类的一些代码示例,展示了ZigBeeNetworkNodeListener类的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeBroadcastDestination类的一些代码示例,展示了ZigBeeBroadcastDestination类
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeStackType类的一些代码示例,展示了ZigBeeStackType类的具体用法。这些代码示例主要来源于Githu
本文整理了Java中com.zsmartsystems.zigbee.security.ZigBeeKey类的一些代码示例,展示了ZigBeeKey类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclStatus类的一些代码示例,展示了ZclStatus类的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute类的一些代码示例,展示了ZclAttribute类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.transport.ZigBeeTransportTransmit类的一些代码示例,展示了ZigBeeTransportTrans
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclCluster类的一些代码示例,展示了ZclCluster类的具体用法。这些代码示例主要来源于Github/Stac
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher类的一些代码示例,展示了ZclTransactionMatcher类的具体用法。
本文整理了Java中com.zsmartsystems.zigbee.dao.ZigBeeNodeDao类的一些代码示例,展示了ZigBeeNodeDao类的具体用法。这些代码示例主要来源于Githu
我是一名优秀的程序员,十分优秀!