2

我正在使用带有 Zigbee 模块的 Java XBEE API 将数据发送到远程 zigbee。我正在使用远程 zigbee 模块的 64 位地址,如下所示:

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

它工作正常,但我不知道0x00JAVA 中的含义是十六进制、整数还是字符串。我有一个包含远程地址的字符串,我想将其用作远程地址,如下所示:

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

但这一次它给出了错误。有谁知道锄头来解决它?

4

1 回答 1

2

根据文档 ,当您省略地址中的 0x 时,这是可能的。

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

String address_64 = "00 13 a2 00 40 a9 d0 d1";
destination = new XBeeAddress64(address_64);
于 2014-04-28T16:39:32.640 回答