bt_scan_filters_clear()
Description
Clears out all of the previously added filters.
Syntax
bt_scan_filters_clear();
Parameters
This function has no parameters.
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Successfully managed to send filters clear command to scan module. |
SCRIPT_OPERATION_FAILED | Failed to send filters clear command to scan module. |
SCRIPT_NO_ACCESS | This error signifies that Bluetooth communication was not initialized. |
Function call example
#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();
bt_scan_filters_clear();
for(;;)
{
Delay(100);
}
}