Add the dbus interface for LE OOB pairing 06/124906/1 accepted/tizen/unified/20170418.072738 submit/tizen/20170418.011550
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 13 Apr 2017 04:09:48 +0000 (13:09 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 13 Apr 2017 04:09:48 +0000 (13:09 +0900)
To use LE OOB pairing, we should assign BD address type in kernel MGMT.
This patchset adds BD address type in the remote oob data setting dbus API.

Change-Id: Ie1c47e43ce8dab9878977aea450b5c2d2e1a5401
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
plugins/dbusoob.c

index 8948d5d..f8f3551 100755 (executable)
@@ -153,11 +153,12 @@ static DBusMessage *add_remote_data(DBusConnection *conn, DBusMessage *msg,
        int32_t h256_len = 0;
        int32_t r256_len = 0;
        bdaddr_t bdaddr;
-       uint8_t addr_type = 0;
+       uint8_t addr_type = BDADDR_BREDR;
        bool valid_len;
 
        if (!dbus_message_get_args(msg, NULL,
                        DBUS_TYPE_STRING, &addr,
+                       DBUS_TYPE_BYTE, &addr_type,
                        DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &hash192, &h192_len,
                        DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &randomizer192, &r192_len,
                        DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &hash256, &h256_len,
@@ -165,6 +166,8 @@ static DBusMessage *add_remote_data(DBusConnection *conn, DBusMessage *msg,
                        DBUS_TYPE_INVALID))
                return btd_error_invalid_args(msg);
 
+       DBG("address type: %d", addr_type);
+
        valid_len = (h192_len == 16 && r192_len == 16) ||
                (h256_len == 16 && r256_len == 16);
 
@@ -207,6 +210,7 @@ static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg,
 static const GDBusMethodTable oob_methods[] = {
        { GDBUS_METHOD("AddRemoteData",
                        GDBUS_ARGS({ "address", "s" },
+                               { "address_type", "y" },
                                { "hash192", "ay" }, { "randomizer192", "ay" },
                                { "hash256", "ay" }, { "randomizer256", "ay" }),
                        NULL,