Whenever selects BR/EDR support in Kconfig, make BLUETOOTH_CONN
option be set as well due to for BR/EDR devices fundamental behaviour
is interact with others by making ACL based connections.
Change-Id: Ieffd2fc6aa47278112be177e5a7e2021e50b0fa3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
As a cleanup of just made disconnection don't touch LE specific
actions.
Change-Id: I0c7c42f47ac8f6683380124df571fa2b2afbf526
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Enables getting by host connection complete event and handle
internal state of related to the event connection object.
Change-Id: Ie6252ff33cc2e1fff5a4ce746fda7c3a59bf8aab
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Defines helper routine to look up conn pool object for existance
of instance matching requested bluetooth address.
Change-Id: I31e05afb2346c7dab14e7ba1bd2f4e1378876ae0
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
To conform to API convention rename BT_CONN_TYPE_BREDR to BT_CONN_TYPE_BR.
Updates stack code so far uses it.
Change-Id: Ia759ef68bbdb232e3b0992740e0536d310e19010
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Applications may want to protect the privacy (identity of the local
device). One way to do this is to generate a Non-resolvable Private
Address and use that when advertising.
Change-Id: Ib852b03c14af062f914aa99a14e50c2e52ac78c2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Calling bt_rand() while holding a HCI cmd net_buf will (at least right
now) allocate a second HCI cmd net_buf. The default HCI cmd net_buf
count is 2, so if the caller of le_set_nrpa() also does a similar
trick this would leave to a deadlock. Doing the bt_rand() call first
solves the issue.
Change-Id: I4d6e3f448930bb1fa0456c9603dce62146fb545e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There's no reason for us to go revealing our public address when doing
active scanning.
Change-Id: I27bed74bb377b8bba75843ea76acb8f0d58f70f7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll need this e.g. for NRPA generation even when SMP isn't enabled.
Change-Id: I4bffca3a180fda8f6757e902f8e255ba497b0bf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Applications may want fine-grained control of connection parameters.
The two APIs to provide this through are bt_le_set_auto_conn() as well
as bt_conn_create_le().
Change-Id: If5cddbbf017b868d768d18d2a09daf4af8aa00d8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There is no need to lookup SMP context again from conn object if
SMP context is already found.
Change-Id: I47ed1da69dc3030021c16579f8039e376ba11320
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If HCI based ECC is used we should delay sending local Public Key in
LE SC pairing until it is generated by controller.
Change-Id: Ic979fc8efa40a8089ac2b74cbcfac21bdca79bfe
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Use same ifdefs rule in all places in SMP code. This makes code
easier to read.
Change-Id: I6936ca6f7a0212fc1918ed18d247f3e6d73f0370
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
SMP code is cutted by ifdefs for central and peripheral roles support.
To make code easier to understand we follow same rule for all code:
if (conn->role == BT_HCI_ROLE_MASTER) {
/* master specififc code */
return;
}
/* slave specififc code */
This simple rule allows for covering all build options (only central,
only peripheral or both) in clean way.
Change-Id: I37e65e7444090860069bfa6e9adc5cae07f0c0b9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allow to reuse same code in follow-up patch.
Change-Id: Ie057943f72b0c3c77d44590b56dd5ff9aa53005f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Add command for choosing the default connection.
Change-Id: Id100320f31cb0e99ab48b162b466f52f6273018a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The state of auto-connectable bt_conn objects needs to be set to
CONNECT_SCAN after init as well as whenever bt_le_set_auto_conn is
called.
Change-Id: Iad2ca32a00ee1b4259196dd20651d5bf94ba9f26
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If the app loaded the stack with some devices to auto-connect to we
should start the background scanning at the end of bt_init().
Change-Id: Ifd06b66b53639344bdca391eb0ed2d3643ee5a07
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This function should depend on BLUETOOTH_CENTRAL and not on
BLUETOOTH_CONN. It should also at least be capable of disabling
scanning even if BLUETOOTH_CENTRAL is not set.
Change-Id: Ic6ccd7ddf07ac6529c64889257dc9f9dfb34b531
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Once we start persistently storing the addresses of devices we want to
reconnect to we also need a way to reload them to the stack. Since we
don't have a connection object at this point the API cannot take that
as a parameter. Instead rename the function and have it take
bt_addr_le_t as a parameter.
The feature was also lacking proper reference counting for the
connection, which this patch now adds (the flag itself owns a
reference). The function is now also possible to call before bt_init()
so that if we load the stack with multiple devices the HCI doesn't get
bombarded with lots of scan enable/disable commands.
Change-Id: I9072bf061eb64f2ecec96f74fb176be13e5bdaee
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This way the app can start passive scanning if it wants.
Change-Id: Iab3e60863d5a1a013a5f069a98664628c7b14418
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll soon add many more parameters, so having a shorter name helps
with readability.
Change-Id: If6384ab0dbb883ea19fa1ad6c81e99432aabd576
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>