- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.zcl.clusters.ZclOtaUpgradeCluster
类的一些代码示例,展示了ZclOtaUpgradeCluster
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclOtaUpgradeCluster
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.clusters.ZclOtaUpgradeCluster
类名称:ZclOtaUpgradeCluster
[英]OTA Upgrade cluster implementation (Cluster ID 0x0019).
The cluster provides a standard way to upgrade devices in the network via OTA messages. Thus the upgrade process MAY be performed between two devices from different manufacturers. Devices are required to have application bootloader and additional memory space in order to successfully implement the cluster.
It is the responsibility of the server to indicate to the clients when update images are available. The client MAY be upgraded or downgraded64. The upgrade server knows which client devices to upgrade and to what file version. The upgrade server MAY be notified of such information via the backend system. For ZR clients, the server MAY send a message to notify the device when an updated image is available. It is assumed that ZED clients will not be awake to receive an unsolicited notification of an available image. All clients (ZR and ZED) SHALL query (poll) the server periodically to determine whether the server has an image update for them. Image Notify is optional.
The cluster is implemented in such a way that the client service works on both ZED and ZR devices. Being able to handle polling is mandatory for all server devices while being able to send a notify is optional. Hence, all client devices must be able to use a ‘poll’ mechanism to send query message to the server in order to see if the server has any new file for it. The polling mechanism also puts fewer resources on the upgrade server. It is ideal to have the server maintain as little state as possible since this will scale when there are hundreds of clients in the network. The upgrade server is not required to keep track of what pieces of an image that a particular client has received; instead the client SHALL do that. Lastly poll makes more sense for devices that MAY need to perform special setup to get ready to receive an image, such as unlocking flash or allocating space for the new image.
Code is auto-generated. Modifications may be overwritten!
[中]OTA升级群集实施(群集ID 0x0019)。
该集群提供了通过OTA消息升级网络设备的标准方式。因此,可以在来自不同制造商的两个设备之间执行升级过程。为了成功实现集群,设备需要有应用程序引导程序和额外的内存空间。
服务器负责向客户端指示何时有更新映像可用。客户端可能会升级或降级64。升级服务器知道要升级哪些客户端设备以及升级到哪个文件版本。可通过后端系统将此类信息通知升级服务器。对于ZR客户端,服务器可能会发送消息,在更新的映像可用时通知设备。假设ZED客户端不会被唤醒以接收可用映像的未经请求的通知。所有客户机(ZR和ZED)都应定期查询(轮询)服务器,以确定服务器是否对其进行了映像更新。图像通知是可选的。
集群的实现方式是,客户机服务可以在ZED和ZR设备上工作。所有服务器设备都必须能够处理轮询,而能够发送通知则是可选的。因此,所有客户端设备必须能够使用“轮询”机制向服务器发送查询消息,以便查看服务器是否有任何新文件。轮询机制还减少了升级服务器上的资源。让服务器保持尽可能少的状态是理想的,因为当网络中有数百个客户端时,这将扩展。升级服务器不需要跟踪特定客户机接收到的图像片段;相反,客户应这样做。最后,对于可能需要执行特殊设置以准备接收图像的设备来说,轮询更有意义,例如解锁闪存或为新图像分配空间。
代码是自动生成的。修改可能会被覆盖!
代码示例来源: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: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void run() {
logger.debug("{}: OTA Error: Timeout - aborting transfer.", cluster.getZigBeeAddress());
updateStatus(ZigBeeOtaServerStatus.OTA_UPGRADE_FAILED);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Get the <i>ManufacturerID</i> attribute [attribute ID <b>7</b>].
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @return the {@link Future<CommandResult>} command result future
*/
public Future<CommandResult> getManufacturerIdAsync() {
return read(attributes.get(ATTR_MANUFACTURERID));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void run() {
try {
Integer statusValue = cluster.getImageUpgradeStatus(0);
if (statusValue == null) {
CommandResult response = cluster.upgradeEndResponse(otaFile.getManufacturerCode(),
otaFile.getImageType(), otaFile.getFileVersion(), 0, 0).get();
if (!(response.isSuccess() || response.isTimeout())) {
Integer fileVersion = cluster.getCurrentFileVersion(0);
if (fileVersion == null) {
continue;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
cluster.getZigBeeAddress(), status);
return;
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
if (command.getHardwareVersion() < otaFile.getMinimumHardware()
|| command.getHardwareVersion() > otaFile.getMaximumHardware()) {
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
startTransferTimer();
cluster.queryNextImageResponse(ZclStatus.SUCCESS, otaFile.getManufacturerCode(), otaFile.getImageType(),
otaFile.getFileVersion(), otaFile.getImageSize());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
cluster.getZigBeeAddress(), status);
return;
logger.debug("{} OTA Error: No file is set.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.UNSUP_CLUSTER_COMMAND);
return;
|| !command.getFileVersion().equals(otaFile.getFileVersion())
|| !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
logger.debug("{} OTA Error: Requested offset is larger than file ({}>{})", cluster.getZigBeeAddress(),
command.getFileOffset(), otaFile.getImageSize());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.MALFORMED_COMMAND);
return;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Synchronously get the <i>ManufacturerID</i> attribute [attribute ID <b>7</b>].
* <p>
* This method can return cached data if the attribute has already been received.
* The parameter <i>refreshPeriod</i> is used to control this. If the attribute has been received
* within <i>refreshPeriod</i> milliseconds, then the method will immediately return the last value
* received. If <i>refreshPeriod</i> is set to 0, then the attribute will always be updated.
* <p>
* This method will block until the response is received or a timeout occurs unless the current value is returned.
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed
* @return the {@link Integer} attribute value, or null on error
*/
public Integer getManufacturerId(final long refreshPeriod) {
if (attributes.get(ATTR_MANUFACTURERID).isLastValueCurrent(refreshPeriod)) {
return (Integer) attributes.get(ATTR_MANUFACTURERID).getLastValue();
}
return (Integer) readSync(attributes.get(ATTR_MANUFACTURERID));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Sends an image block to the client
*
* @param fileOffset the offset into the {@link ZigBeeOtaFile} to send the block
* @param maximumDataSize the maximum data size the client can accept
* @return the number of bytes sent
*/
private int sendImageBlock(int fileOffset, int maximumDataSize) {
ByteArray imageData = otaFile.getImageData(fileOffset, Math.min(dataSize, maximumDataSize));
logger.debug("{} OTA Data: Sending {} bytes at offset {}", cluster.getZigBeeAddress(), imageData.size(),
fileOffset);
cluster.imageBlockResponse(ZclStatus.SUCCESS, otaFile.getManufacturerCode(), otaFile.getImageType(),
otaFile.getFileVersion(), fileOffset, imageData);
return imageData.size();
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* The purpose of sending Image Notify command is so the server has a way to notify client devices of
* when the OTA upgrade images are available for them. It eliminates the need for ZR client devices
* having to check with the server periodically of when the new images are available. However, all client
* devices still need to send in Query Next Image Request command in order to officially start the OTA
* upgrade process.
*/
public void notifyClient() {
// Only send the notify if the file is set
if (otaFile == null) {
return;
}
cluster.imageNotifyCommand(0, queryJitter, otaFile.getManufacturerCode(), otaFile.getImageType(),
otaFile.getFileVersion());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
(ZigBeeTransactionMatcher) ArgumentMatchers.anyObject());
ZclOtaUpgradeCluster cluster = new ZclOtaUpgradeCluster(endpoint);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
cluster.getZigBeeAddress(), status);
return;
logger.debug("{} OTA Error: No file is set.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.UNSUP_CLUSTER_COMMAND);
return;
|| !command.getFileVersion().equals(otaFile.getFileVersion())
|| !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
logger.debug("{} OTA Error: Requested offset is larger than file ({}>{})", cluster.getZigBeeAddress(),
command.getFileOffset(), otaFile.getImageSize());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.MALFORMED_COMMAND);
return;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Synchronously get the <i>ImageTypeID</i> attribute [attribute ID <b>8</b>].
* <p>
* This method can return cached data if the attribute has already been received.
* The parameter <i>refreshPeriod</i> is used to control this. If the attribute has been received
* within <i>refreshPeriod</i> milliseconds, then the method will immediately return the last value
* received. If <i>refreshPeriod</i> is set to 0, then the attribute will always be updated.
* <p>
* This method will block until the response is received or a timeout occurs unless the current value is returned.
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed
* @return the {@link Integer} attribute value, or null on error
*/
public Integer getImageTypeId(final long refreshPeriod) {
if (attributes.get(ATTR_IMAGETYPEID).isLastValueCurrent(refreshPeriod)) {
return (Integer) attributes.get(ATTR_IMAGETYPEID).getLastValue();
}
return (Integer) readSync(attributes.get(ATTR_IMAGETYPEID));
}
代码示例来源: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
&& status != ZigBeeOtaServerStatus.OTA_TRANSFER_COMPLETE) {
logger.debug("{} OTA Error: Invalid server state {} when handling UpgradeEndCommand.",
cluster.getZigBeeAddress(), status);
return;
|| !command.getFileVersion().equals(otaFile.getFileVersion())
|| !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
return;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Get the <i>ImageStamp</i> attribute [attribute ID <b>10</b>].
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @return the {@link Future<CommandResult>} command result future
*/
public Future<CommandResult> getImageStampAsync() {
return read(attributes.get(ATTR_IMAGESTAMP));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Synchronously get the <i>DownloadedFileVersion</i> attribute [attribute ID <b>4</b>].
* <p>
* The file version of the downloaded image on additional memory space on the device. The information
* is available for the server to query via ZCL read attribute command. The information is useful for the
* OTA upgrade management, so the server shall ensure that each client has downloaded the correct file
* version before initiate the upgrade. The attribute is optional on the client.
* <p>
* This method can return cached data if the attribute has already been received.
* The parameter <i>refreshPeriod</i> is used to control this. If the attribute has been received
* within <i>refreshPeriod</i> milliseconds, then the method will immediately return the last value
* received. If <i>refreshPeriod</i> is set to 0, then the attribute will always be updated.
* <p>
* This method will block until the response is received or a timeout occurs unless the current value is returned.
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed
* @return the {@link Integer} attribute value, or null on error
*/
public Integer getDownloadedFileVersion(final long refreshPeriod) {
if (attributes.get(ATTR_DOWNLOADEDFILEVERSION).isLastValueCurrent(refreshPeriod)) {
return (Integer) attributes.get(ATTR_DOWNLOADEDFILEVERSION).getLastValue();
}
return (Integer) readSync(attributes.get(ATTR_DOWNLOADEDFILEVERSION));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Send an updated status on OTA progress to the listeners
*
* @param updatedStatus the new {@link ZigBeeOtaServerStatus}
*/
private void updateStatus(final ZigBeeOtaServerStatus updatedStatus) {
logger.debug("{} OTA status updated to {}.", cluster.getZigBeeAddress(), updatedStatus);
status = updatedStatus;
synchronized (this) {
// Notify the listeners
for (final ZigBeeOtaStatusCallback statusListener : statusListeners) {
NotificationService.execute(new Runnable() {
@Override
public void run() {
statusListener.otaStatusUpdate(updatedStatus, percentComplete);
}
});
}
}
}
代码示例来源: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
/**
* Get the <i>ImageTypeID</i> attribute [attribute ID <b>8</b>].
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @return the {@link Future<CommandResult>} command result future
*/
public Future<CommandResult> getImageTypeIdAsync() {
return read(attributes.get(ATTR_IMAGETYPEID));
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Synchronously get the <i>CurrentFileVersion</i> attribute [attribute ID <b>2</b>].
* <p>
* 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 method can return cached data if the attribute has already been received.
* The parameter <i>refreshPeriod</i> is used to control this. If the attribute has been received
* within <i>refreshPeriod</i> milliseconds, then the method will immediately return the last value
* received. If <i>refreshPeriod</i> is set to 0, then the attribute will always be updated.
* <p>
* This method will block until the response is received or a timeout occurs unless the current value is returned.
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is OPTIONAL
*
* @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed
* @return the {@link Integer} attribute value, or null on error
*/
public Integer getCurrentFileVersion(final long refreshPeriod) {
if (attributes.get(ATTR_CURRENTFILEVERSION).isLastValueCurrent(refreshPeriod)) {
return (Integer) attributes.get(ATTR_CURRENTFILEVERSION).getLastValue();
}
return (Integer) readSync(attributes.get(ATTR_CURRENTFILEVERSION));
}
COM 内存泄漏最常见的原因是什么? 我读过将初始化的 CComBSTR 的地址作为 [out] 参数传递给函数会导致泄漏。我正在寻找像这样枚举其他常见的编程错误。 最佳答案 未能为 COM 对象使用
在COM服务器执行过程中分配一 block 内存,然后通过一个输出参数将该内存块传递给客户端是很常见的。然后,客户端有义务使用 CoTaskMemFree() 等方法释放该内存。 问题是,这 bloc
我有一些 MFC 代码(自定义 CWnd 控件和一些要公开的类),我需要将它们制作成带有接口(interface)的 activex/COM 对象。使用 MFC 支持制作 ATL 项目并以这种方式制作
Devenv.com 是 visual studio 命令行界面,当您键入 devenv/? 时,devenv 的帮助会出现在控制台上。但是,如果没有任何选项,devenv.com 只会调用 deve
如何将 COM 接口(interface)的引用作为 COM 库中的参数传递? 这是示例: 1)客户端代码成功创建coclass并接收到pFunctionDiscovery中的接口(interface
我正在使用 django,我在 s3 中存储了诸如 imgs 之类的东西(为此我使用的是 boto),但最近我收到了这个错误: 'foo.bar.com.s3.amazonaws.com' doesn
我已经使用组件服务 MSC 对话框创建了一个 COM+ 应用程序。我将一个现有的 COM 对象导入到这个新的 COM+ 应用程序中。 我知道可以通过 COM+ 应用程序调用该 COM 对象。我可以简单
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve thi
我正在使用通过 COM Interop 包装器公开的第三方 dll。但是,其中一个 COM 调用经常卡住(至少从不返回)。为了至少让我的代码更健壮一些,我异步包装了调用(_getDeviceInfoW
很多年前我读到有一个简单的 php 脚本可以将您的网站重定向到 http://example.com/google.com 到 google.com它适用于正斜杠右侧的任何域。我忘记了这个脚本是什么或
我正在实现我的第一个进程外 COM 服务器(我的第一个 COM 服务器,就此而言)。我已经按照步骤编写了一个 IDL 文件,为代理/ stub DLL 生成代码,编译 DLL,并注册它。 当我检查注册
是否可以在未知接口(interface)上增加 RCW 引用计数? (即不是底层 COM 对象的引用计数) 我有一些旧的 COM 服务器代码 int Method1(object comobject)
我注意到许多关于 COM 的书籍等都指出,在 COM 聚合中实现一个可用作内部对象的对象相对容易。但是,除非我遗漏了什么,否则聚合似乎只能在极其有限的场景中成功,因此只有在明确识别出这种场景时才应提供
假设我正在开发一个安装 COM 组件并安装程序注册它们的应用程序。这很好用。 现在该软件需要从内存棒上运行。如何注册我的库运行时并确保在运行应用程序后清理注册表? 最佳答案 您总是在 XP 或更高版本
我们已经使用Microsoft的ActiveX/COM(VB6)技术开发了一个软件系统。去年,我对自动化构建过程和整个SCM越来越感兴趣。我集中搜索了网络的大部分内容,以获取有关如何使用基于COM的软
我对 com 线程模型有点困惑。 我有一个 inproc 服务器,我想创建一个可从任何线程访问的接口(interface),而不管 CoInitializeEx 中使用的线程模型和/或标志。 当将接口
我的包以旁加载方式安装,并不断遇到特定于应用程序的权限错误。 是的,许多人建议在 regedit 和组件服务中手动更改权限和所有者。 我的应用实际上在组件服务(DCOMCNFG、DCOMCNFG -3
我正在使用第三方应用程序,并调用创建 的实例。我的 COM 对象。这个调用成功了,但是第三方应用程序上的函数没有返回指向创建对象的指针(我不知道为什么)。有没有办法获得指向我的对象的指针? 为了澄清,
我有一个用 C# 编写的托管 COM 对象和一个用 C++(MFC 和 ATL)编写的 native COM 客户端和接收器。客户端创建对象并在启动时向其事件接口(interface)提供建议,并在其
我的应用程序需要注册两个 COM DLL。如果用户有必要的访问权限,它会自动完成,否则可以使用 regsvr32 完成。 . 现在在一些工作站上会发生以下情况: 开始cmd.exe作为管理员 注册第一
我是一名优秀的程序员,十分优秀!