return btd_error_failed(msg, "Get Raw RSSI Failed");
}
+static DBusMessage *get_irk(DBusMessage *msg, uint8_t *irk_info,
+ uint16_t irk_size)
+{
+ DBusMessage *reply;
+ DBusMessageIter iter, array;
+ reply = g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
+
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "y", &array);
+ dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE,
+ &irk_info, irk_size);
+ dbus_message_iter_close_container(&iter, &array);
+
+ return reply;
+}
+
+
+static DBusMessage *adapter_get_local_irk(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct btd_adapter *adapter = data;
+ if (!adapter->local_irk) {
+ if (!load_local_irk(adapter))
+ return g_dbus_create_error(msg, DBUS_ERROR_NO_MEMORY, "No Memory");
+ }
+ return get_irk(msg, adapter->local_irk, MGMT_IRK_SIZE);
+}
+
#if !defined(__SPRD_PATCH__)
static void get_adv_tx_power_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{ "interval", "u" },
{ "window", "u" }), NULL,
adapter_le_set_scan_params) },
+ { GDBUS_METHOD("GetLocalIrk",
+ NULL,
+ GDBUS_ARGS({ "value", "ay" }),
+ adapter_get_local_irk) },
{ GDBUS_ASYNC_METHOD("scan_filter_param_setup",
GDBUS_ARGS({ "client_if", "i" }, { "action", "i" },
{ "filt_index", "i" }, { "feat_seln", "i"},