Node Discovery

XBee modules provide some features for discovering and searching nodes.

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. This structure has the next fields:

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

  • 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

  • DT: Device Type (Not used in 802.15.4)

  • 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

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 that 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:

{
xbeeDM.scanNetwork();
}

Related variables:

xbeeDM.totalScannedBrothers // stores the number of discovered brothers
xbeeDM.scannedBrothers // Node structure array that stores the info

Scan network example: https://development.libelium.com/dm-10-scan-network/

Searching specific nodes

Another possibility for discovering a node is searching for a specific one. This search is based on using the Node Identifier. The NI of the node to discover is used as the input in the API function responsible of this purpose.

Example of use:

{
uint8_t mac[8];
xbeeDM.nodeSearch("node01", mac);
}

Related variables:

mac[0-7] // Stores the 64-bit address of the searched node

Node search example: https://development.libelium.com/dm-11a-node-search-tx/ https://development.libelium.com/dm-11b-node-search-rx/

Node discovery to a specific node

When executing a Node Discovery all the nodes respond to it. If its Node Identifier is known, a Node Discovery using its NI as an input can be executed.

Example of use:

{
xbeeDM.scanNetwork("node01");
}

Related variables:

xbeeDM.totalScannedBrothers // stores the number of discovered brothers. Must be ‘1’.
xbeeDM.scannedBrothers // Node structure array that stores the info

Node Discovery Time

It is the amount of time (NT) a node will wait for responses from other nodes when performing a ND. Range: 0X20 to 0X2EE0 [x100 ms]. Default value: 0x0082.

Example of use:

{
uint8_t time[2]={0x00,0x82};
xbeeDM.setScanningTime(time);
xbeeDM.getScanningTime();
}

Available information:

xbeeDM.scanTime[0-1] // stores the time a node will wait for responses.

Last updated