return _bt_hal_device_get_trusted_profile(bd_addr, profile, trusted);
}
+static int get_device_ida(bt_bdaddr_t *bd_addr, bt_bdaddr_t *id_addr)
+{
+ DBG("");
+ return _bt_hal_device_get_ida(bd_addr, id_addr);
+}
+
static int get_connected_link_rssi_strength(bt_bdaddr_t *bd_addr, uint32_t conn_link_type)
{
DBG("");
.unregister_agent_osp_server = unregister_agent_osp_server,
.set_trusted_profile = set_trusted_profile,
.get_trusted_profile = get_trusted_profile,
+ .get_device_ida = get_device_ida,
.enable_rssi_monitoring = enable_rssi_monitoring,
.get_connected_link_rssi_strength = get_connected_link_rssi_strength,
.enable_gap_auth_notifications = enable_gap_auth_notifications,
trusted_flag, trusted);
}
+int _bt_hal_device_get_ida(bt_bdaddr_t *bd_addr, bt_bdaddr_t *id_addr)
+{
+ char address[BT_HAL_ADDRESS_STRING_SIZE] = { 0 };
+ gchar *device_path = NULL;
+ const gchar *idaddress = NULL;
+ GDBusProxy *device_proxy;
+ GError *error = NULL;
+ GVariant *result = NULL;
+ GDBusConnection *conn;
+ int ret = BT_STATUS_SUCCESS;
+
+ if (bd_addr == NULL)
+ return BT_STATUS_PARM_INVALID;
+
+ conn = _bt_hal_get_system_gconn();
+
+ if (!conn) {
+ ERR("_bt_hal_get_system_gconn failed");
+ return BT_STATUS_FAIL;
+ }
+
+ _bt_hal_convert_addr_type_to_string(address, bd_addr->address);
+
+ DBG("The device_address is: [%s]", address);
+
+ device_path = _bt_hal_get_device_object_path(address);
+
+ if (!device_path) {
+ ERR("_bt_hal_get_device_object_path failed");
+ return BT_STATUS_FAIL;
+ }
+
+ device_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, BT_HAL_BLUEZ_NAME, device_path,
+ BT_HAL_DEVICE_INTERFACE, NULL, NULL);
+ g_free(device_path);
+ if (!device_proxy) {
+ ERR("Unable to get proxy");
+ return BT_STATUS_FAIL;
+ }
+
+ result = g_dbus_proxy_call_sync(device_proxy, "GetIDAddress", NULL,
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+ if (result == NULL) {
+ ERR("Failed to get device ID address");
+
+ ret = BT_STATUS_FAIL;
+ if (error != NULL) {
+ g_dbus_error_strip_remote_error(error);
+ ERR("Error occured in Proxy call [%s]", error->message);
+ if (g_strcmp0(error->message, "Does Not Exist") == 0)
+ ERR("Device does not exist");
+ g_error_free(error);
+ }
+ g_object_unref(device_proxy);
+ return ret;
+ }
+
+ g_variant_get(result , "(&s)", &idaddress);
+
+ DBG_SECURE("ID Address : %s", idaddress);
+ _bt_hal_convert_addr_string_to_type(id_addr->address, idaddress);
+
+ g_variant_unref(result);
+ g_object_unref(device_proxy);
+
+ return ret;
+}
+
int _bt_hal_device_enable_rssi_monitoring(bt_bdaddr_t *bd_addr, uint32_t link_type,
int low_threshold, int in_range_threshold, int high_threshold)
{
int _bt_hal_device_get_trusted_profile(const bt_bdaddr_t *bd_addr,
bt_trusted_profile_t profile, uint32_t *trusted);
+int _bt_hal_device_get_ida(bt_bdaddr_t *bd_addr, bt_bdaddr_t *id_addr);
+
int _bt_hal_device_enable_rssi_monitoring(bt_bdaddr_t *bd_addr, uint32_t conn_link_type,
int low_threshold, int in_range_threshold, int high_threshold);
int (*get_trusted_profile)(bt_bdaddr_t *bd_addr, bt_trusted_profile_t profile, uint32_t *trusted);
/**
+ * Gets the identity address of the remote device
+ */
+ int (*get_device_ida)(bt_bdaddr_t *bd_addr, bt_bdaddr_t *id_addr);
+
+ /**
* Get raw RSSI strength of remote device for connected link type
* conn_link_type: (0 = BR/EDR link, 1 = LE link, 0xFF = Any (Default))
*/
oal_status_t device_set_trust_profile(bt_address_t *addr, oal_trusted_profile_e profile, gboolean trust);
/**
+ * @brief Gets the identity address for remote device
+ *
+ * @details This API is used to get the identity address for the remote device
+ *
+ * @param[in] device_address: Remote device address.
+ *
+ * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
+ * @retval #OAL_STATUS_SUCCESS Successful
+ *
+ */
+oal_status_t device_get_ida(bt_address_t *addr, bt_address_t *id_addr);
+
+/**
* @brief Set profile trust info for remote device
*
* @details This API is used to set profile as trusted/blocked for remote device
return OAL_STATUS_SUCCESS;
}
+oal_status_t device_get_ida(bt_address_t *device_address, bt_address_t *id_address)
+{
+ int res;
+
+ CHECK_OAL_INITIALIZED();
+
+ OAL_CHECK_PARAMETER(device_address, return);
+
+ API_TRACE();
+
+ res = blued_api->get_device_ida((bt_bdaddr_t*) device_address, (bt_bdaddr_t*) id_address);
+
+ if (res != BT_STATUS_SUCCESS)
+ BT_ERR("get_device_IDA failed: [%s]",status2string(res));
+
+ res = convert_to_oal_status(res);
+ return res;
+}
+
oal_status_t device_accept_pin_request(bt_address_t * addr, const char * pin)
{
int res;
}
break;
}
+ case BT_GET_DEVICE_IDA: {
+ bluetooth_device_address_t address = { {0} };
+ bluetooth_device_address_t id_addr = { {0} };
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = _bt_device_get_ida(&address, &id_addr);
+
+ if (result == BLUETOOTH_ERROR_NONE) {
+ g_array_append_vals(*out_param1, &id_addr,
+ sizeof(bluetooth_device_address_t));
+ }
+ break;
+ }
case BT_SET_LE_STATIC_RANDOM_ADDRESS: {
gboolean is_enable;
return BLUETOOTH_ERROR_NONE;
}
+int _bt_device_get_ida(bluetooth_device_address_t *device_address, bluetooth_device_address_t *id_address)
+{
+ int result = BLUETOOTH_ERROR_NONE;
+ char address[BT_ADDRESS_STRING_SIZE] = { 0 };
+
+ _bt_convert_addr_type_to_string(address, device_address->addr);
+
+ BT_DBG("getting IDA for remote device: [%s]", address);
+
+ result = device_get_ida((bt_address_t*)device_address, (bt_address_t*)id_address);
+
+ if (result != OAL_STATUS_SUCCESS) {
+ BT_ERR("device_get_ida Failed %d", result);
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ return result;
+}
+
#ifdef TIZEN_GATT_CLIENT
static bt_connected_le_dev_t *__bt_get_le_connected_dev_info(const char *address)
{
int _bt_get_le_connection_parameter(bluetooth_le_connection_mode_t mode,
bluetooth_le_connection_param_t *param);
+int _bt_device_get_ida(bluetooth_device_address_t *device_address,
+ bluetooth_device_address_t *id_address);
#ifdef __cplusplus
}
#endif /* __cplusplus */