Go Down

Topic: Get address from incoming Xbee packet using Xbee library (Read 2289 times) previous topic - next topic


I need a nudge in the right direction.
I am using 3 series 2 xbee radios.  2 set up as routers in AT mode and 1 as the coordinator in API mode. 
I need to identify which radio is sending a packet to the coordinator. 
I am using the Xbee library  I/O sample code and an LCD screen.

If I use the following line of code,
Code: [Select]
LCD.print(ioSample.getRemoteAddress64().getLsb(), HEX);
I get the lower part of the sender's address, 407AIF83
How do I get this into a variable or string so I can compare it?
If I use the following line of code to put it into a string, all I get is the # 16.
Code: [Select]
String radioID =(ioSample.getRemoteAddress64().getLsb(), HEX);
I get the number 16, instead of a string like 407AIF83.
Really want I want to end up with is a statement like the following pseudo code

if (ioSample.getRemoteAddress64().getLsb(), HEX) == '407AIF83')
   do x;

do Y;

Any help is appreciated.


The class XBeeAddress has a toString() method which might give you exactly what you need?


Thanks TomS  but,
I can't seem to find  toString() in the Xbee library.
Anyone have any examples or point me to where it is in the library?


Well, according to the API it should be there.

So this doesn't work for you?
Code: [Select]
String radioID = ioSample.getRemoteAddress64().toString();


No, the message I get is:
'Class XBeeAddress64' has no member name 'toString'


Hi Pauly, do you solve this problem? I found that I met the same problem with you. Could you please tell me how to solve it?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131