+ g_variant_unref(reply);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+int _bt_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
+{
+ GDBusProxy *proxy;
+ GVariant *reply;
+ GError *err = NULL;
+ char *adapter_path;
+ GDBusConnection *conn;
+ GVariant *eir = NULL;
+
+ BT_CHECK_PARAMETER(local_oob_data, return);
+
+ conn = _bt_gdbus_get_system_gconn();
+ retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
+
+ adapter_path = _bt_get_adapter_path();
+ retv_if(adapter_path == NULL, BLUETOOTH_ERROR_INTERNAL);
+
+ proxy = g_dbus_proxy_new_sync(conn,
+ G_DBUS_PROXY_FLAGS_NONE, NULL,
+ BT_BLUEZ_NAME, adapter_path,
+ BT_OOB_INTERFACE, NULL, &err);
+ g_free(adapter_path);
+ if (!proxy) {
+ BT_ERR("Unable to create proxy");
+ if (err) {
+ BT_ERR("Error: %s", err->message);
+ g_clear_error(&err);
+ }
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ if (device_power_request_lock(POWER_LOCK_CPU, 2000) != DEVICE_ERROR_NONE)
+ BT_ERR("device_power_request_lock() failed");
+ else
+ BT_ERR("device_power_request_lock() succeed");
+
+ reply = g_dbus_proxy_call_sync(proxy, "LEReadLocalData",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE, -1,
+ NULL, &err);
+ g_object_unref(proxy);
+
+ if (reply == NULL) {
+ BT_ERR("LEReadLocalData dBUS-RPC is failed");
+ if (err != NULL) {
+ BT_ERR("D-Bus API failure: errCode[%x], message[%s]",
+ err->code, err->message);
+ g_clear_error(&err);
+ }
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ g_variant_get(reply, "(@ay)", &eir);
+ g_variant_unref(reply);
+
+ if (eir) {
+ local_oob_data->eir_len = __get_oob_data_from_variant(eir,
+ local_oob_data->eir,
+ sizeof(local_oob_data->eir));
+ g_variant_unref(eir);
+ }