attie / libxbee3

A C/C++ library to aid the use of Digi XBee radios in API mode
GNU Lesser General Public License v3.0
68 stars 40 forks source link

Retrieve the MAC address of a module #37

Closed skalkoto closed 6 years ago

skalkoto commented 6 years ago

Hello,

Is there a way to retrieve the mac-address of a module? I python you can just call get_64bit_addr() on the device after you open it. What about in libxbee3?

Thank you in advance, Nikos

attie commented 6 years ago

What are you trying to do?

Get a local module's address - e.g: ATSH and ATSL

The 64-bit address of the local device must be retrieved using a Local AT connection - this example will get the device's NI / "Node Identifier"... you can swap this for SH and SL.

Get a remote module's address - e.g: from an incoming message

The 64-bit address of a remote device is available in the xbee_conAddress structure, in the xbee_pkt structure - e.g:

pkt->address.addr64[]
skalkoto commented 6 years ago

I was referring to the local module. The Local AT connection should do. Thanx a lot.

attie commented 6 years ago

No problem!