本文整理了Java中com.zsmartsystems.zigbee.zcl.clusters.ZclOtaUpgradeCluster.getCurrentFileVersion()
方法的一些代码示例,展示了ZclOtaUpgradeCluster.getCurrentFileVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclOtaUpgradeCluster.getCurrentFileVersion()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.clusters.ZclOtaUpgradeCluster
类名称:ZclOtaUpgradeCluster
方法名:getCurrentFileVersion
[英]Synchronously get the CurrentFileVersion attribute [attribute ID 2].
The file version of the running firmware image on the device. The information is available for the server to query via ZCL read attribute command. The attribute is optional on the client.
This method can return cached data if the attribute has already been received. The parameter refreshPeriod is used to control this. If the attribute has been received within refreshPeriod milliseconds, then the method will immediately return the last value received. If refreshPeriod is set to 0, then the attribute will always be updated.
This method will block until the response is received or a timeout occurs unless the current value is returned.
The attribute is of type Integer.
The implementation of this attribute by a device is OPTIONAL
[中]同步获取CurrentFileVersion属性[属性ID 2]。
设备上正在运行的固件映像的文件版本。服务器可以通过ZCL read attribute命令查询这些信息。该属性在客户端上是可选的。
如果已经接收到属性,该方法可以返回缓存数据。参数refreshPeriod用于控制这一点。如果在refreshPeriod毫秒内收到属性,则该方法将立即返回最后收到的值。如果refreshPeriod设置为0,则该属性将始终更新。
除非返回当前值,否则此方法将一直阻止,直到收到响应或出现超时。
该属性的类型为Integer。
设备对该属性的实现是可选的
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* The file version of the running firmware image on the device. The information is available for the server to
* query via ZCL read attribute command. The attribute is optional on the client.
* <p>
* This calls the synchronous method in the cluster, and always performs an update (ie will not use cached data) to
* ensure it is updated following any OTA upgrade operation.
*
* @return the current firmware version on the remote device
*/
public Integer getCurrentFileVersion() {
return cluster.getCurrentFileVersion(Long.MAX_VALUE);
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
Integer fileVersion = otaCluster.getCurrentFileVersion(Long.MAX_VALUE);
if (fileVersion != null) {
properties.put(Thing.PROPERTY_FIRMWARE_VERSION, String.format("%08X", fileVersion));
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getCurrentFileVersion() {
ZclOtaUpgradeCluster cluster = Mockito.mock(ZclOtaUpgradeCluster.class);
Mockito.when(cluster.getCurrentFileVersion(ArgumentMatchers.anyLong())).thenReturn(1234);
ZclOtaUpgradeServer server = new ZclOtaUpgradeServer();
server.appStartup(cluster);
assertEquals(Integer.valueOf(1234), server.getCurrentFileVersion());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Integer fileVersion = cluster.getCurrentFileVersion(0);
if (fileVersion == null) {
continue;
内容来源于网络,如有侵权,请联系作者删除!