bt_scan_filter_disable()

bt_scan_filter_disable()

Description

Disables all filters. All previously added filters will remain intact, but they will be deactivated, retaining the option to re-enable them at a later time.

Syntax

bt_scan_filter_disable();

Parameters

This function has no parameters.

Returns

Return value

Return explanation

SCRIPT_OPERATION_SUCCESS

Successfully managed to send filter disable command to scan module.

SCRIPT_OPERATION_FAILED

Failed to send filter disable command to scan module.

SCRIPT_NO_ACCESS

This error signifies that Bluetooth communication was not initialized.

Function call example

The code initializes Bluetooth module, initializes scan module and disables scan filters:
#include <io> #include <read> #include <float> #include <string> #include <core> #include <write> #include <define> #include <socket> #include <bluetooth> new scan_parameters[.type, .options, .interval, .window, .timeout, .interval_coded, .window_coded]; new mac_addr_filter[] = [0xFF, 0x48, 0x80, 0x33, 0xE3, 0xA8]; main() { scan_parameters[.type] = BT_SCAN_TYPE_ACTIVE; scan_parameters[.options] = BT_ADV_OPT_NONE; scan_parameters[.interval] = BT_SCAN_INTERVAL_FAST; scan_parameters[.window] = BT_SCAN_WINDOW_FAST; scan_parameters[.timeout] = 0; scan_parameters[.interval_coded] = 0; scan_parameters[.window_coded] = 0; bt_init(); bt_scan_init(scan_parameters); bt_scan_filter_add(BT_SCAN_FILTER_TYPE_ADDR_PUBLIC, mac_addr_filter, sizeof(mac_addr_filter)); bt_scan_filter_enable((BT_SCAN_FILTER_NAME | BT_SCAN_FILTER_ADDR), false); bt_scan_filter_disable(); for(;;) { Delay(100); } }