简体   繁体   中英

Get the MAC address of an XBee using Node.js

My Node.js app is using xbee-api to allow an XBee connected via a serial port to communicate wirelessly with other XBees. The local XBee is in API Coordinator mode.

How can I query the XBee (physically connected via serial port) to get its 64 bit MAC address SH and SL ?

I tried writing the following frame to serial,

var frame_obj = {
    type: xbee_api.constants.FRAME_TYPE.AT_COMMAND,
    command: 'SH',
      commandParameter: []
};

but I receive four bytes [ 0, 19, 162, 0 ] which makes no sense...

frame: { type: 136,
   id: 2,
   command: 'SH',
   commandStatus: 0,
   commandData: [ 0, 19, 162, 0 ] }

如果您查看以十六进制表示的字节(0x00、0x13、0xA2、0x00),这确实很有意义。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM