Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: discovering the nodes around
PostPosted: Mon Apr 30, 2012 7:45 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
i'm trying to make the node discover the available nodes around it and their RSSI and their battery level. i tried to use the 'scanned brother' subroutine but i'm facing some problems. it always get me error:

In function 'void loop()':
error: invalid conversion from 'uint8_t*' to 'long int


here's the code:

[color=#00FF80]void setup()
{
// Inits the XBee ZigBee library
xbeeZB.init(ZIGBEE,FREQ2_4G,NORMAL);

// Powers XBee
xbeeZB.ON();
}

void loop()
{
xbeeZB.scanNetwork(); // Discovery nodes

while (xbeeZB.totalScannedBrothers>0)
{
XBee.println("Network Address:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].MY,HEX);

XBee.println("Device Type:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].DT,HEX);

XBee.println("Device MAC High:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].SH,HEX);

XBee.println("Device MAC Low:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].SL,HEX);

XBee.println("Node Identifier:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].NI,HEX);

XBee.println("Device RSSI:");
XBee.print(xbeeZB.scannedBrothers[xbeeZB.totalScannedBrothers-1].RSSI,HEX);

xbeeZB.totalScannedBrothers--;
}
}
could anyone check the code and help please?
thanks


Top
 Profile  
 
 Post subject: Re: discovering the nodes around
PostPosted: Wed May 02, 2012 10:07 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7812
Hi Smart Agriculture,

that's because some of the parameters that you are trying to print are not unsigned bytes or integers but arrays of unsigned bytes, so direct conversion is not possible, you'll have to print them separately.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use