Embed: (wiki syntax)

« Back to documentation index

net_nwk_scan.h File Reference

net_nwk_scan.h File Reference

Link layer Scan API for Active and Energy Detection Scan API. More...

Go to the source code of this file.

Data Structures

struct  nwk_pan_alternative_parent_t
 Network alternative parent structure. More...
struct  nwk_pan_descriptor_t
 Linked network response list. More...

Functions

int8_t arm_net_energy_scan (int8_t interface_id, channel_list_s *scan_list, void(*passed_fptr)(int8_t if_id, const mlme_scan_conf_t *conf), uint8_t energy_tresshold)
 Energy detection scan start for configured channel with application-specific threshold.
int8_t arm_net_nwk_scan (int8_t interface_id, channel_list_s *scan_list, void(*passed_fptr)(int8_t if_id, const mlme_scan_conf_t *conf), uint8_t scan_level)
 Active network scan for configured channels.
nwk_pan_descriptor_tarm_net_get_scanned_nwk_list (int8_t interface_id)
 Active scan result read.

Detailed Description

Link layer Scan API for Active and Energy Detection Scan API.

Scan API works only when stack is in idle state.

The scan operation result is handled at callback function that is defined by scan function call. The scan result format is as follows:

| Data pointer | VALUE | | :----------: | :---------------------------------------------------: | | 1.Byte | Scan Type: NET_NWK_ENERGY_SCAN or NET_NWK_ACTIVE_SCAN | | 2.Byte | Result length | | 3+n Bytes | Payload :Read Only at Energy Detection type |

The result length indicates the scan response size as follows:

  • NET_NWK_ENERGY_SCAN Payload length is result length *2 bytes after length field. * 1.Byte Channel * 2.Byte Energy Level
  • NET_NWK_ACTIVE_SCAN result indicates the the number of networks. * The network list needs to be read by net_get_scanned_nwk_list().

Definition in file net_nwk_scan.h.


Function Documentation

int8_t arm_net_energy_scan ( int8_t  interface_id,
channel_list_s scan_list,
void(*)(int8_t if_id, const mlme_scan_conf_t *conf)  passed_fptr,
uint8_t  energy_tresshold 
)

Energy detection scan start for configured channel with application-specific threshold.

Parameters:
interface_idInterface id.
scan_listChannel list for scan operation.
passed_fptrA function pointer for scan result notify.
energy_tressholdScan response lists all channels with smaller or equal level.
Returns:
0 Scan operation started OK.
-1 Stack is active.
-2 Channel list not valid.
-3 Function not enabled at border router.

Definition at line 101 of file ns_net.c.

nwk_pan_descriptor_t* arm_net_get_scanned_nwk_list ( int8_t  interface_id )

Active scan result read.

Note: The pointer is only valid at callback function call time. The application needs to allocate memory if it wants to save the result.

Returns:
>0 A pointer to scan result.
0 No network results available.

Definition at line 191 of file ns_net.c.

int8_t arm_net_nwk_scan ( int8_t  interface_id,
channel_list_s scan_list,
void(*)(int8_t if_id, const mlme_scan_conf_t *conf)  passed_fptr,
uint8_t  scan_level 
)

Active network scan for configured channels.

Parameters:
interface_idInterface id.
scan_listChannel list for scan operation.
passed_fptrA function pointer for scan result notify.
scan_levelNET_ACTIVE_SCAN_ONLY_NWK, NET_ACTIVE_SCAN_ACCEPT_ANY_BEACON_PAYLOAD,NET_ACTIVE_SCAN_ACCEPT_ONLY_ZIP_SPESIFIC
Returns:
0 Scan operation started OK.
-1 Stack is active.
-2 Channel list not valid.
-3 Function not enabled at border router.

Definition at line 142 of file ns_net.c.