-22-
v7.1
Node Discovery
8. Node Discovery
XBee modules provide some features for discovering and searching nodes.
8.1. Structure used in Discovery
Discovering nodes is used to discover and report all modules on its current operating channel and PAN ID.
To store the reported information by other nodes, a structure called Node has been created.
struct Node
{
uint8_t MY[2];
uint8_t SH[4];
uint8_t SL[4];
char NI[20];
uint8_t PMY[2];
uint8_t DT;
uint8_t ST;
uint8_t PID[2];
uint8_t MID[2];
uint8_t RSSI;
};
•
MY
: 16-bit Network Address of the reported module (always 0xFFFE).
•
SH[4]
and
SL[4]
: 64-bit MAC Source Address of the reported module.
•
NI
: Node Identifier of the reported module.
•
PMY
: Parent 16-bit network address. It specifies the 16-bit network address of its parent (always 0xFFFE).
•
DT
: Device Type. It specifies if the node is a Coordinator (0), Router (1) or End Device (2).
•
ST
: Status (Reserved).
•
PID
: Profile ID. Profile ID used to application layer addressing.
•
MID
: Manufacturer ID. ID set by the manufacturer to identify the module.
•
RSSI
: RSSI of last hop (disabled in XBee 868LP by default).
To store the found brothers, an array called
scannedBrothers
has been created. It is an array of structures
Node
. To
specify the maximum number of found brothers, it is defined a constant called
MAX_BROTHERS
. It is also a variable
called
totalScannedBrothers
that indicates the number of brothers have been discovered. Using this variable as
index in the
scannedBrothers
array, it will be possible to read the information about each node discovered.
Example of use:
{
xbee868LP.scanNetwork();
}
Related variables:
totalScannedBrothers
→
stores the number of discovered brothers
scannedBrothers
→
Node structure array that stores the info
•
Scan network example:
http://www.libelium.com/development/waspmote/examples/868lp-09-scan-network