gpt4 book ai didi

java - JAVA中的Zigbee地址

转载 作者:行者123 更新时间:2023-11-30 09:08:49 25 4
gpt4 key购买 nike

我正在使用带有 Zigbee 模块的 Java XBEE API 将数据发送到远程 zigbee。我像这样使用远程 zigbee 模块的 64 位地址:

XBeeAddress64 destination = new XBeeAddress64(0x00, 0x13,0xa2,0x00,0x40,0xa9,0xd0,0xd1);

它工作正常,但我不知道 0x00 在 JAVA 中是什么意思,无论是十六进制、整数还是字符串。我有一个包含远程地址的字符串,我想像这样将其用作远程地址:

address_64 = "0x00 0x13 0xa2 0x00 0x40 0xa9 0xd0 0xd1";
destination = new XBeeAddress64(address_64);

但是这次报错了。有谁知道如何解决?

最佳答案

According to the documentation当您省略地址中的 0x 时,这是可能的。

您的地址字符串应该如下所示:

String address_64 = "00 13 a2 00 40 a9 d0 d1";
destination = new XBeeAddress64(address_64);

关于java - JAVA中的Zigbee地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23342339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com