GVariant *value = NULL;
GVariant *ret = NULL;
int result = BLUETOOTH_ERROR_INTERNAL;
- BT_INFO("+");
+
retv_if(remote_uuid == NULL, BLUETOOTH_ERROR_INTERNAL);
gconn = _bt_get_system_private_conn();
retv_if(gconn == NULL, BLUETOOTH_ERROR_INTERNAL);
#include "bt-service-gatt.h"
#include "bt-service-util.h"
#include "bt-service-core-device.h"
+#include "bt-service-oob.h"
#include "bt-service-battery-monitor.h"
#include <oal-hardware.h>
static bt_le_status_t adapter_le_state = BT_LE_DEACTIVATED;
static bt_le_discovery_state_t adapter_le_discovery_state = LE_DISCOVERY_STOPPED;
+static bool is_static_random_address = false;
+
/******************************************* LE Scan *********************************************/
#define BT_LE_SCAN_INTERVAL_MIN 2.5
#define BT_LE_SCAN_INTERVAL_MAX 10240
BT_INFO("_bt_adapter_post_set_disabled>>");
/* Add LE disabled post processing codes */
+ _bt_le_oob_reset_local_cache_data();
+ is_static_random_address = false;
return FALSE;
}
} else {
BT_INFO("SetLeStaticRandomAddress as %d", is_enable);
result = BLUETOOTH_ERROR_NONE;
+ is_static_random_address = is_enable;
}
return result;
}
+
+bool _bt_is_le_static_random_address_enabled(void)
+{
+ return is_static_random_address;
+}
}
case BT_LE_OOB_READ_LOCAL_DATA: {
bt_oob_data_t local_oob_data;
+ bt_oob_data_t *local_oob_cache_data;
+
+ local_oob_cache_data = _bt_le_oob_get_local_cache_data();
+ if (local_oob_cache_data && local_oob_cache_data->eir_len) {
+ g_array_append_vals(*out_param1, local_oob_cache_data,
+ sizeof(bt_oob_data_t));
+ return BLUETOOTH_ERROR_NONE;
+ }
+
+ /* We should modify this logic in later */
+ if (_bt_is_le_static_random_address_enabled() == false) {
+ /* Seperate BT & LE address */
+ _bt_set_le_static_random_address(TRUE);
+ }
- memset(&local_oob_data, 0x00, sizeof(bt_oob_data_t));
result = _bt_le_oob_read_local_data(&local_oob_data);
+ _bt_le_oob_set_local_cache_data(&local_oob_data);
g_array_append_vals(*out_param1, &local_oob_data,
sizeof(bt_oob_data_t));
int _bt_set_le_static_random_address(gboolean is_enable);
+bool _bt_is_le_static_random_address_enabled(void);
+
int _bt_set_le_privacy(gboolean set_privacy);
int _bt_set_white_list(bluetooth_device_address_t *device_address, int address_type, bool is_add);
#include "bt-service-oob.h"
#include "bt-service-event.h"
+static bt_oob_data_t local_le_oob_cache_data = {0, };
+
static int __get_oob_data_from_variant(GVariant *variant,
unsigned char *buf, int size)
{
return BLUETOOTH_ERROR_INTERNAL;
}
+ BT_INFO("Get LE OOB data");
reply = g_dbus_proxy_call_sync(proxy, "LEReadLocalData",
NULL,
G_DBUS_CALL_FLAGS_NONE, -1,
return BLUETOOTH_ERROR_NONE;
}
+void _bt_le_oob_reset_local_cache_data(void)
+{
+ memset(&local_le_oob_cache_data, 0x00, sizeof(bt_oob_data_t));
+}
+
+bt_oob_data_t *_bt_le_oob_get_local_cache_data(void)
+{
+ if (local_le_oob_cache_data.eir_len)
+ return &local_le_oob_cache_data;
+ else
+ return NULL;
+}
+
+void _bt_le_oob_set_local_cache_data(bt_oob_data_t *data)
+{
+ memcpy(&local_le_oob_cache_data, data, sizeof(bt_oob_data_t));
+}
+
int _bt_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
+void _bt_le_oob_reset_local_cache_data(void);
+
+bt_oob_data_t *_bt_le_oob_get_local_cache_data(void);
+
+void _bt_le_oob_set_local_cache_data(bt_oob_data_t *data);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */