Implement MLE Discovery Request and Response. (#322)

This commit is contained in:
Jonathan Hui
2016-08-03 13:16:35 -07:00
committed by GitHub
parent 2fe487f0e8
commit b326f01821
18 changed files with 1149 additions and 95 deletions
+2
View File
@@ -160,6 +160,8 @@ typedef struct otExtAddress
*
*/
#define OT_PANID_BROADCAST 0xffff ///< IEEE 802.15.4 Broadcast PAN ID
#define OT_CHANNEL_11_MASK (1 << 11) ///< Channel 11
#define OT_CHANNEL_12_MASK (1 << 12) ///< Channel 12
#define OT_CHANNEL_13_MASK (1 << 13) ///< Channel 13
+23 -1
View File
@@ -232,7 +232,7 @@ typedef void (*otHandleActiveScanResult)(otActiveScanResult *aResult);
*
* @param[in] aScanChannels A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK).
* @param[in] aScanDuration The time in milliseconds to spend scanning each channel.
* @param[in] aCallback A pointer to a function that is called when a beacon is received or the scan completes.
* @param[in] aCallback A pointer to a function called on receiving a beacon or scan completes.
*
* @retval kThreadError_None Accepted the Active Scan request.
* @retval kThreadError_Busy Already performing an Active Scan.
@@ -247,6 +247,28 @@ ThreadError otActiveScan(uint32_t aScanChannels, uint16_t aScanDuration, otHandl
*/
bool otActiveScanInProgress(void);
/**
* This function starts a Thread Discovery scan.
*
* @param[in] aScanChannels A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK).
* @param[in] aScanDuration The time in milliseconds to spend scanning each channel.
* @param[in] aPanId The PAN ID filter (set to Broadcast PAN to disable filter).
* @param[in] aCallback A pointer to a function called on receiving an MLE Discovery Response or scan completes.
*
* @retval kThreadError_None Accepted the Thread Discovery request.
* @retval kThreadError_Busy Already performing an Thread Discovery.
*
*/
ThreadError otDiscover(uint32_t aScanChannels, uint16_t aScanDuration, uint16_t aPanid,
otHandleActiveScanResult aCallback);
/**
* This function determines if an MLE Thread Discovery is currently in progress.
*
* @returns true if an active scan is in progress.
*/
bool otDiscoverInProgress(void);
/**
* @}
*