diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-05 11:50:35 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-05 11:50:35 +0000 |
commit | 94f7643c52193c905edaff767c2e9a31b9102a73 (patch) | |
tree | a180e64bba234feecf4496c5a7246dd35bbc264d /hcid/dbus-hci.c | |
parent | 41e8f6dc730096d303b71175adc508a66126ea06 (diff) |
Add support for fetching IO capability from an agent
Diffstat (limited to 'hcid/dbus-hci.c')
-rw-r--r-- | hcid/dbus-hci.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index b28b5c7d..14261bfe 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -2269,6 +2269,41 @@ 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) +{ + struct adapter *adapter; + struct device *device; + struct agent *agent; + char addr[18]; + + adapter = find_adapter(local); + if (!adapter) { + error("No matching adapter found"); + return -1; + } + + ba2str(remote, addr); + + device = adapter_find_device(adapter, addr); + if (device && device->agent) { + agent = device->agent; + *auth = 0x03; + } else { + agent = adapter->agent; + *auth = 0x01; + } + + if (!agent) { + error("No agent available for IO capability"); + return -1; + } + + *cap = agent_get_io_capability(agent); + + return 0; +} + static int inquiry_cancel(int dd, int to) { struct hci_request rq; |