#include "bt-event-handler.h"
static gboolean is_le_scanning = FALSE;
+static int is_scan_filter_supported = -1;
BT_EXPORT_API int bluetooth_check_adapter_le(void)
{
{
int result;
- retv_if(bluetooth_check_adapter_le() == BLUETOOTH_ADAPTER_LE_ENABLED,
- BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED);
-
BT_INIT_PARAMS();
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return is_discovering;
}
+BT_EXPORT_API gboolean bluetooth_is_scan_filter_supported(void)
+{
+ int result;
+
+ if (is_scan_filter_supported == -1) {
+ BT_INIT_PARAMS();
+ BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_SCAN_FILTER_SUPPORTED,
+ in_param1, in_param2, in_param3, in_param4, &out_param);
+
+ if (result == BLUETOOTH_ERROR_NONE) {
+ is_scan_filter_supported = g_array_index(out_param, int, 0);
+ } else {
+ BT_ERR("Fail to send request");
+ }
+
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+ }
+
+ if (is_scan_filter_supported == 1) {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
BT_EXPORT_API int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
{
int result;
return result;
}
+BT_EXPORT_API int bluetooth_set_le_static_random_address(gboolean enable)
+{
+ int result;
+
+ BT_CHECK_ENABLED_ANY(return);
+
+ BT_INIT_PARAMS();
+ BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ g_array_append_vals(in_param1, &enable, sizeof(gboolean));
+
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_LE_STATIC_RANDOM_ADDRESS,
+ in_param1, in_param2, in_param3, in_param4, &out_param);
+
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ return result;
+}
+
BT_EXPORT_API int bluetooth_check_privilege_advertising_parameter(void)
{
if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_SET_ADVERTISING_PARAMETERS)