1.2.2.1.1.4.50 BLE_GAP_SetExtScanningEnable
C
uint16_t BLE_GAP_SetExtScanningEnable(uint8_t mode, BLE_GAP_ExtScanningEnable_T *p_enable);
Description
Enable or disable extended scanning.
Note
If this API with enable set to true is called while scanning is already enabled, the timers used for duration and period are reset to the new parameter values and a new scan period is started.
The duration of a scan period refers to the time spent scanning on both the primary and secondary advertising physical channels.
If scanning is started and advertising packet or scan response is received then the event BLE_GAP_EVT_EXT_ADV_REPORT is generated.
This API belongs to extended advertising feature. It will be disallowed if any one API that belongs to legacy advertising feature is issued before. Categories of advertising APIs and events for details of advertising APIs.
BLE_GAP_ScanInit and BLE_GAP_ExtScanInit are required for this API.
Events generated
BLE_GAP_EVT_EXT_ADV_REPORT Generated when ext. scan enabled.
BLE_GAP_EVT_SCAN_TIMEOUT Generated when ext. scan enabled and timeout (by duration).
Parameters
Parameter | Description |
---|---|
[in] mode | Scan mode. See Scan mode. |
[in] p_enable | Pointer to BLE_GAP_ExtScanningEnable_T structure buffer. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully enable or disable extended scanning. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | Invalid parameters. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed. |