NB SCAN
NB SCAN (Neighbour Scan) is used to search for neighbouring nodes.
The node performing the search sends a broadcast request for a response. Surrounding nodes respond to this and report a list of nodes that have responded. The nodes are sorted by LQI.
Only available on SimpleNet.
Under relatively stable and low traffic conditions, the success rate of the search will be high, but if conditions deteriorate, the search may not be possible at all.
In poor conditions, the node that should announce its presence periodically sends beacon packets using broadcast communication, and the searcher receives these beacons and implements a check for the presence of neighbouring nodes.
Definitions
The searcher should define ToCoNet_USE_MOD_NBSCAN
and the searched should define ToCoNet_USE_MOD_NBSCAN_SLAVE
.
functions
ToCoNet_EnergyScan_bStart()
Start the neighbourhood search.
Arguments
Type | Name | Remark |
---|---|---|
uint32 | u32ChMask | Channel mask to search ( |
uint16 | u16Dur_ms | The search time for each channel. Roughly 50ms or more is recommended. |
Returns
Type | Remark |
---|---|
boot_t | If |
ToCoNet_NbScan_bStartToFindAddr()
A neighbourhood search is started with the aim of finding a node at a specific address.
The existence of a node on the same channel can be checked by attempting to send a packet with MAC Ack, but this is used when the node's channel configuration is unknown.
Arguments
Type | Name | Remark |
---|---|---|
|
| Channel mask to search ( |
|
| The long address of the node to be searched. |
Returns
Type | Remark |
---|---|
| If |
Events
The result is reported by cbToCoNet_vNwkEvent()
in the E_EVENT_TOCONET_NWK_SCAN_COMPLETE
event. The event argument is the address to the tsToCoNet_NbScan_Result
structure.
the value of pu8Result
[0] | Number of channels measured [N] |
---|---|
[1] | Measured level of the channel with the youngest number. |
[2] | Next youngest channel |
... [N] | Continues up to N. |
The level takes the value 0..255, with 0 being the weakest and 255 the strongest. The higher the value, the noisier the channel.
Structures
tsToCoNet_NbScan_Result
A structure to store the results of the neighbourhood search.
|
| Count of found nodes |
|
| Scan method. |
|
| Index of the |
|
| Found node information |
bitmap information of u8scanMode
Bitmask | Remark |
---|---|
| by the |
| by the |
tsToCoNet_NbScan_Entitiy
A structure containing information about each node found in the neighbourhood search.
Type | Name | Remark |
---|---|---|
|
| Long address of the node. |
|
| Short address of the node. |
|
| The channel of the node that was discovered. |
|
| LQI of the discovered node. |
|
| If the search succeeds, |
Sample code
最終更新