1.1.2.1.1.4.64 BLE_GAP_SetScanningEnable

C

uint16_t BLE_GAP_SetScanningEnable(bool enable, uint8_t filterDuplicate, uint8_t mode, uint16_t duration);

Description

Start or stop scanning.

Note

Scanning is used to discover advertising devices nearby. If the enable parameter is set to true and scanning is already enabled, any change to the filterDuplicate setting shall take effect.

This API belongs to legacy advertising feature. It will be disallowed if any one API belongs extended advertising feature is issued before. Categories of advertising APIs and events for details of advertising APIs.

BLE_GAP_ScanInit is required for this API.

Parameters

ParameterDescription
[in] enableStart or stop scanning. Set true to start scanning.
[in] filterDuplicateDuplicate Filter policy, see Scan filter duplicate option. Only BLE_GAP_SCAN_FD_DISABLE /BLE_GAP_SCAN_FD_ENABLE are valid.
[in] modeScan mode. See Scan modes.
[in] durationScan duration (Unit :100 ms)

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully enable or disable scanning.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters, if any of the parameters are out of range.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed when extended Adv. feature is in-use.