From dbdb49795bbc09144656fcce11ae7926aefba6da Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 20 Feb 2014 15:05:56 +0200 Subject: [PATCH] core: Track LE & BR/EDR support separately for devices --- src/device.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/device.c b/src/device.c index 2eefc53e2..c7c5f585f 100644 --- a/src/device.c +++ b/src/device.c @@ -158,6 +158,8 @@ struct btd_device { bdaddr_t bdaddr; uint8_t bdaddr_type; char *path; + bool bredr; + bool le; bool pending_paired; /* "Paired" waiting for SDP */ bool svc_resolved; bool svc_refreshed; @@ -2216,6 +2218,12 @@ struct btd_device *device_create(struct btd_adapter *adapter, return NULL; device->bdaddr_type = bdaddr_type; + + if (bdaddr_type == BDADDR_BREDR) + device->bredr = true; + else + device->le = true; + sba = btd_adapter_get_address(adapter); ba2str(sba, src); @@ -2307,6 +2315,11 @@ void device_update_addr(struct btd_device *device, const bdaddr_t *bdaddr, bdaddr_type == device->bdaddr_type) return; + /* Since this function is only used for LE SMP Identity + * Resolving purposes we can now assume LE is supported. + */ + device->le = true; + bacpy(&device->bdaddr, bdaddr); device->bdaddr_type = bdaddr_type; -- 2.47.3