MiApp_SearchConnection Function

MiWi Development Environment

MiWi(TM) Development Environment Help
MiApp_SearchConnection Function
C
BYTE MiApp_SearchConnection(
    BYTE ScanDuration, 
    DWORD ChannelMap
);
Description

This is the primary user interface function for the application layer to perform an active scan. After this function call, all active scan response will be stored in the global variable ActiveScanResults in the format of structure ACTIVE_SCAN_RESULT. The return value indicates the total number of valid active scan response in the active scan result array.

Preconditions

Protocol initialization has been done.

Parameters
Parameters 
Description 
BYTE ScanDuration 
The maximum time to perform scan on single channel. The value is from 5 to 14. The real time to perform scan can be calculated in following formula from IEEE 802.15.4 specification 960 * (2^ScanDuration + 1) * 10^(-6) second 
DWORD ChannelMap 
The bit map of channels to perform noise scan. The 32-bit double word parameter use one bit to represent corresponding channels from 0 to 31. For instance, 0x00000003 represent to scan channel 0 and channel 1. 
Returns

The number of valid active scan response stored in the global variable ActiveScanResults.

Remarks

None

Example
// Perform an active scan on all possible channels
NumOfActiveScanResponse = MiApp_SearchConnection(10, 0xFFFFFFFF);
Microchip My Application xx.yy - [Jan 1, 2009]
Copyright © 2009 Microchip Technology, Inc.  All rights reserved.