- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.app.otaserver.ZigBeeOtaFile
类的一些代码示例,展示了ZigBeeOtaFile
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeOtaFile
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.app.otaserver.ZigBeeOtaFile
类名称:ZigBeeOtaFile
[英]Defines a ZigBee Over The Air upgrade file.
This class will read the file header, and each tag from the file and provide methods to read this data within the ZclOtaUpgradeServer.
The OTA file format is composed of a header followed by a number of sub-elements. The header describes general information about the file such as version, the manufacturer that created it, and the device it is intended for. Sub-elements in the file may contain upgrade data for the embedded device, certificates, configuration data, log messages, or other manufacturer specific pieces. Below is an example file.
The OTA Upgrade image file name should contain the following information at the beginning of the name with each field separated by a dash (“-“): manufacturer code, image type and file version. The value of each field stated should be in hexadecimal number and in capital letter. Each manufacturer may append more information to the name as seen fit to make the name more specific. The OTA Upgrade file extension should be “.zigbee”.
[中]定义ZigBee空中升级文件。
此类将从文件中读取文件头和每个标记,并提供在ZclOtaUpgradeServer中读取这些数据的方法。
OTA文件格式由一个标题和多个子元素组成。标题描述了有关文件的一般信息,例如版本、创建该文件的制造商以及该文件的目标设备。文件中的子元素可能包含嵌入式设备的升级数据、证书、配置数据、日志消息或其他特定于制造商的部分。下面是一个示例文件。
OTA升级映像文件名应在名称开头包含以下信息,每个字段用短划线(“-”)分隔:制造商代码、图像类型和文件版本。每个字段的值应为十六进制数和大写字母。每个制造商可能会在名称后添加更多信息,以使名称更加具体。OTA升级文件扩展名应为“.zigbee”。
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* {@inheritDoc}
*/
@Override
public boolean process(final ZigBeeApi zigbeeApi, final String[] args, PrintStream out) throws Exception {
if (args.length != 2) {
return false;
}
Path file = FileSystems.getDefault().getPath("./", args[1]);
byte[] fileData = Files.readAllBytes(file);
ZigBeeOtaFile otaFile = new ZigBeeOtaFile(fileData);
print("OTA File: " + otaFile, out);
return true;
}
}
代码示例来源: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
@Test
public void testOpenFile() throws IOException {
Path file = FileSystems.getDefault().getPath("./src/test/resource/", "test_ota_file.test");
byte[] fileData = Files.readAllBytes(file);
ZigBeeOtaFile otaFile = new ZigBeeOtaFile(fileData);
System.out.println(otaFile);
assertEquals(Integer.valueOf(0x1234), otaFile.getManufacturerCode());
assertEquals(Integer.valueOf(0x0006), otaFile.getImageType());
assertEquals(Integer.valueOf(0x12345678), otaFile.getFileVersion());
assertEquals(ZigBeeStackType.ZIGBEE_PRO, otaFile.getStackVersion());
assertEquals("A.String", otaFile.getHeaderString());
assertEquals(Integer.valueOf(78), otaFile.getImageSize());
assertEquals(new ByteArray(new byte[] { 0x1E, (byte) 0xF1, (byte) 0xEE, 0x0B }), otaFile.getImageData(0, 4));
assertEquals(new ByteArray(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }), otaFile.getImageData(62, 5));
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
if (otaFile == null || !(command.getManufacturerCode().equals(otaFile.getManufacturerCode())
&& command.getImageType().equals(otaFile.getImageType()))) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
if (command.getHardwareVersion() != null && otaFile.getMinimumHardware() != null
&& otaFile.getMaximumHardware() != null) {
if (command.getHardwareVersion() < otaFile.getMinimumHardware()
|| command.getHardwareVersion() > otaFile.getMaximumHardware()) {
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
if (!allowExistingFile && command.getFileVersion().equals(otaFile.getFileVersion())) {
cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
ZclStatus.NO_IMAGE_AVAILABLE);
startTransferTimer();
cluster.queryNextImageResponse(ZclStatus.SUCCESS, otaFile.getManufacturerCode(), otaFile.getImageType(),
otaFile.getFileVersion(), otaFile.getImageSize());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
if (otaFile == null || !command.getManufacturerCode().equals(otaFile.getManufacturerCode())
|| !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(),
if (command.getFileOffset() > otaFile.getImageSize()) {
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);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Mockito.when(otaFile.getManufacturerCode()).thenReturn(123);
Mockito.when(otaFile.getImageType()).thenReturn(987);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
if (otaFile == null || !command.getManufacturerCode().equals(otaFile.getManufacturerCode())
|| !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(),
if (command.getFileOffset() > otaFile.getImageSize()) {
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);
int percent = command.getFileOffset() * 100 / otaFile.getImageSize();
if (percent > 100) {
percent = 100;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
CommandResult response = cluster.upgradeEndResponse(otaFile.getManufacturerCode(),
otaFile.getImageType(), otaFile.getFileVersion(), 0, 0).get();
if (!(response.isSuccess() || response.isTimeout())) {
updateStatus(ZigBeeOtaServerStatus.OTA_UPGRADE_FAILED);
if (fileVersion.equals(otaFile.getFileVersion())) {
updateStatus(ZigBeeOtaServerStatus.OTA_UPGRADE_COMPLETE);
return;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
if (otaFile == null || !command.getManufacturerCode().equals(otaFile.getManufacturerCode())
|| !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(),
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Path file = FileSystems.getDefault().getPath("./", args[2]);
byte[] fileData = Files.readAllBytes(file);
ZigBeeOtaFile otaFile = new ZigBeeOtaFile(fileData);
print("OTA File: " + otaFile, out);
代码示例来源:origin: openhab/org.openhab.binding.zigbee
ZigBeeOtaFile otaFile = new ZigBeeOtaFile(firmware.getBytes());
otaServer.setFirmware(otaFile);
Zigbee 和 Zigbee PRO 之间有什么区别(如果有)? 我在维基百科和 official Zigbee site 上找不到任何具体内容这一切都归结为一些优化。 实际使用上有什么区别吗? 最
是否可以使用 XBee PRO S2B 与 ZigBee HA(家庭自动化)配置文件传感器进行通信?如果可以,如何进行通信?有谁知道我在哪里可以找到有关 ZigBee HA 配置文件的规范? 非常感谢
我已经有一段时间不了解 ZigBee 了。谁拥有最成熟的 Zigbee 堆栈?是 Microchip、Chipcon 还是 Atmel? 是否有价格低于 10 美元的 RF 模块? 我记得不久前某些堆
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我目前正在研究 ZigBee,我遇到了以下问题: 每个 ZigBee 设备都有一个 16 位短地址,这意味着我最多可以连接 2^16=65536 个不同的设备(当然减去一些保留地址)。现在每个设备最多
关于这个问题,我询问了一些从事ZigBee应用开发的开发人员。他们告诉我,一个 radio 模块(对我来说,这是指一个节点,同一件事)在形成网络时只能有一个配置文件。 但是,当我阅读“Drew Gis
智能家居连接,不仅仅只有 Wi-Fi 和蓝牙这些大家熟悉的技术,还有一些更加符合智能家居应用的行业专有协议,比如Zigbee,Z-Wave 和 Thread等等。 当谈到家庭自动化时
本文整理了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类
我是一名优秀的程序员,十分优秀!