BLE_GAP_SetExtScanningEnable

C

uint16_t BLE_GAP_SetExtScanningEnable(uint8_t mode, BLE_GAP_ExtScanningEnable_T *p_enable);

Description

Enables or disables extended scanning.

Note

If scanning is already enabled and this API is called with 'enable' set to true, the scan duration and period timers are reset to the new values, and a new scan period begins. The scan period duration includes time spent scanning on both primary and secondary advertising channels. When an advertising packet or scan response is received, the BLE_GAP_EVT_EXT_ADV_REPORT event is generated. This API is part of the extended advertising feature and is disallowed if any legacy advertising feature API has been used previously. See Categories of advertising APIs and events for details on advertising APIs. Initialization with BLE_GAP_ScanInit and BLE_GAP_ExtScanInit is required before using this API.

Parameters

ParameterDescription
[in] modeScan mode. Refer to Scan modes for possible values.
[in] p_enablePointer to a BLE_GAP_ExtScanningEnable_T structure specifying scan enable parameters.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully enables or disables extended scanning.
MBA_RES_OOMInternal memory allocation failure occurred.
MBA_RES_INVALID_PARAThe parameters provided are invalid.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed due to a conflicting operation or state.