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>
For background/implicit/reconnection scanning we have fixed internal
parameters that we want to use. For explicit scanning on the other
hand the parameters come from the application. It makes therefore
sense to split the functions responsible for starting each scanning
type.
Change-Id: I0e89a1ce89aca61870f789c7f1e5ad81f97cd00e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The explicit scan API should be thought of as the user taking control
of the scanning policy. In this case the stack shouldn't try to
second-guess and create connections in between.
Change-Id: I47cc5d70660706d6657deac50aa0619cbe4bf727
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
All current user just want basic active scanning so a corresponding
macro makes more sense than something based on duplicate filtering.
Change-Id: I97787be24b89fad66f2a952c5d53ab76f4e062fb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Current MTU size was not sufficient to test GATT Client, where lower
tester requires to send data of length 512 +opcode +BT address.
This exceeds current BTP_MTU size.
Change-Id: I090c47975ecfe9a657d6ff1158b5dc764c8a78a1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Both places in the central app that enable scanning should do
duplicate filtering.
Change-Id: If7086667c78878355dc246aa3d0b5ebcbdd0ac7b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This uses BT_UUID_DECLARE_16 in macros that can only be of 16 bits
format.
Change-Id: I45d4bcca9859a2e279b1199546891df75a039589
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes it easier to declare 16 and 128 bits UUIDS and also save space
in case of 16 bits.
Change-Id: I5790afd9504ee0cca4a951be6bc542685d0a35fb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
We'll need to have a much more flexible LE advertising API. This is a
first step in that direction. A convenience BT_LE_ADV() macro is
provided to ease converting application code.
Change-Id: I74854487bbdfb4b1cf1bee0b6351d1750a56ff86
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll need to have a much more flexible LE scanning API. This is a
first step towards it. The existing BT_LE_SCAN_FILTER_DUP_* enum
values are converted to macros to avoid having to update application
code at this point.
Change-Id: I0c8d29dc156bad67cddc9401c0d72aee8ec6d8de
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The function cannot do what it's intended to do if we're already
advertising.
Change-Id: I3dabb24591f655c5faf48da9395e826b2b61cfe9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In JustWorks/PasskeyConfirmation pairing slave doesn't check remote
confirmation value (as it doesn't receive one). Factor out confirmation
check to helper and use it only when needed. This keeps code easy to
understand.
Change-Id: Ifb31bc3f2b53586a9c92b29b01e9832c124b0951
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Issue causing crash is already fixed so now proper BE to cpu convertion
can be used.
Change-Id: If07ed6f3b342b9e6a58e62c9a6f5fee9bc11133a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
bt_br_* is equally understandable and the same length as the
corresponding bt_le_* prefix on the LE side.
Change-Id: I1820f9b9fab6363b696072f6b70d57c0bc780078
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To have a clear split between LE & BR/EDR rename these APIs with the
appropriate prefixes.
Change-Id: I983df2b5880947d96f0ad289d12f3383f44894be
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch fixes the calculation of maximum data that can be sent
by Write Request.
Maximum data is MTU reduced by size of handle and command opcode.
Change-Id: I2abeef9adffd65e24a2489ad084bfa3b810e4acf
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This patch fixes warning that ATT MTU exceeded. An opcode size should
be taken into account.
Change-Id: Ia69c9514a59767542cca0ef36fc77d896d20db28
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
The data length was incorrect which caused the name to be truncated.
Change-Id: Ieaca7745fff89f0f5689b6d15bfc0386f59add47
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
For test purpose pass NULL to bt_enable so it blocks until init
sequence is complete.
Change-Id: I875ff9a59bb3d1d2e799db6fc967da3aee3ac77a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is a left over of 41edeffb721b4b00321ee5ff1777adc69009fe6d which
attempted to fix the include path of contiki sources but apparently
missed null_fragmentation.h.
Change-Id: I42bf1ee2e8b4809c1bb623c73279ea1146ddeeae
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This allows to request user to input passkey displayed on remote
device when LE SC connection are used. Since similar method was
already present in legacy pairing no new public API is required.
Change-Id: I331647d5442e65162d25bbdd37ceb8b1ed841fc6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
When Passkey Entry protocol is used for LE SC and device has
display capabilities random passkey is generated and displayed
to user.
Passkey Entry is different that Passkey Confirm due to common
secret (entered passkey) being injected at begining of pairing.
After that 20 passkey rounds are performed to disclose passkey.
This "gradual disclosure" prevents leakage of more than 1 bit of
un-guessed Passkey information in the case of a MITM attack.
Due to 20 rounds of confirm-random PDU exchange this pairing
method takes more time comparing to JustWorks or Passkey Comparison.
Since similar method was already present in legacy pairing no new
public API is required.
Change-Id: Ibb36320dc751e4fae43aa8c08ca57a2a984bf491
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
SMP_FLAG_TK_VALID and SMP_FLAG_USER_CONFIRM flags can be replaced
by single flag that express 'waiting for user input'. This makes
code simpler and easier to follow. Same flag will be used for
passkey entry pairing.
Change-Id: Icb857b07e3f5db1ef870cb4bc09a5f5d9efbca6a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This prepares code for introducing more pairing methods for LE SC.
Changes in following patches will be easier to review.
Change-Id: I59ea283c4dcf8537808ddf71a63df7c6ca34a5f6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Instead of struct forward declaration there should be used
struct type with at least empty body.
Otherwise compiler doesn't know the size of variable of that type
used later and emits error.
Change-Id: Ie0643ed92b8eb95c1d55c9295117a2a9b8cc95cc
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Adds capability to stack to make controller discoverable and
connectable.
Change-Id: Iffe380d2bde0c193f806b76cce3933914c9a4796
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>