summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-11 01:46:01 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-11 01:46:01 +0000
commit0b850e269ad6ca4a17e5177928a4e17c14b293ad (patch)
tree76e6d8b14b3f369c6eea64fdfcac22ba0bd422f3 /hcid
parenta6f07d2bf12942854072c37c3c42d7447921beee (diff)
Parse the IO capa response event
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-hci.c10
-rw-r--r--hcid/dbus-hci.h6
-rw-r--r--hcid/security.c16
3 files changed, 28 insertions, 4 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index c7be87e3..106660a2 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -2435,8 +2435,8 @@ void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr)
}
}
-int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap,
- uint8_t *auth)
+int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
+ uint8_t *cap, uint8_t *auth)
{
struct adapter *adapter;
struct device *device;
@@ -2478,6 +2478,12 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap,
return 0;
}
+int hcid_dbus_set_io_cap(bdaddr_t *local, bdaddr_t *remote,
+ uint8_t cap, uint8_t auth)
+{
+ return 0;
+}
+
static int inquiry_cancel(int dd, int to)
{
struct hci_request rq;
diff --git a/hcid/dbus-hci.h b/hcid/dbus-hci.h
index 00d6540a..9f782fc8 100644
--- a/hcid/dbus-hci.h
+++ b/hcid/dbus-hci.h
@@ -54,8 +54,10 @@ void hcid_dbus_setscan_enable_complete(bdaddr_t *local);
void hcid_dbus_write_class_complete(bdaddr_t *local);
void hcid_dbus_write_simple_pairing_mode_complete(bdaddr_t *local);
void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr);
-int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap,
- uint8_t *auth);
+int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
+ uint8_t *cap, uint8_t *auth);
+int hcid_dbus_set_io_cap(bdaddr_t *local, bdaddr_t *remote,
+ uint8_t cap, uint8_t auth);
int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey);
int hcid_dbus_user_passkey(bdaddr_t *sba, bdaddr_t *dba);
int hcid_dbus_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey);
diff --git a/hcid/security.c b/hcid/security.c
index 9472930b..b4520745 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -423,6 +423,18 @@ static void io_capa_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
}
}
+static void io_capa_response(int dev, bdaddr_t *sba, void *ptr)
+{
+ evt_io_capability_response *evt = ptr;
+ char sa[18], da[18];
+
+ ba2str(sba, sa); ba2str(&evt->bdaddr, da);
+ info("io_capa_response (sba=%s, dba=%s)", sa, da);
+
+ hcid_dbus_set_io_cap(sba, &evt->bdaddr,
+ evt->capability, evt->authentication);
+}
+
/* PIN code handling */
void set_pin_length(bdaddr_t *sba, int length)
@@ -887,6 +899,10 @@ static gboolean io_security_event(GIOChannel *chan, GIOCondition cond, gpointer
io_capa_request(dev, &di->bdaddr, (bdaddr_t *) ptr);
break;
+ case EVT_IO_CAPABILITY_RESPONSE:
+ io_capa_response(dev, &di->bdaddr, ptr);
+ break;
+
case EVT_USER_CONFIRM_REQUEST:
user_confirm_request(dev, &di->bdaddr, ptr);
break;