diff options
| -rw-r--r-- | hcid/dbus-hci.c | 18 | ||||
| -rw-r--r-- | hcid/device.h | 4 | 
2 files changed, 22 insertions, 0 deletions
| diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index e770e70d..8700f4d1 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -2473,6 +2473,24 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,  int hcid_dbus_set_io_cap(bdaddr_t *local, bdaddr_t *remote,                                                  uint8_t cap, uint8_t auth)  { +	struct adapter *adapter; +	struct device *device; +	char addr[18]; + +	adapter = manager_find_adapter(local); +	if (!adapter) { +		error("No matching adapter found"); +		return -1; +	} + +	ba2str(remote, addr); + +	device = adapter_get_device(connection, adapter, addr); +	if (device) { +		device->cap = cap; +		device->auth = auth; +	} +  	return 0;  } diff --git a/hcid/device.h b/hcid/device.h index 985a7b46..b476b1da 100644 --- a/hcid/device.h +++ b/hcid/device.h @@ -40,6 +40,10 @@ struct device {  	gboolean	temporary;  	struct agent	*agent;  	guint		disconn_timer; + +	/* For Secure Simple Pairing */ +	uint8_t		cap; +	uint8_t		auth;  };  struct device *device_create(DBusConnection *conn, struct adapter *adapter, | 
