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>
Passkey should be entered with leading zeros so print them to avoid
user confusion. Due to printk limitation (no support for padding or
precision operators for decimal numbers) snprintf is used for
convertion.
Change-Id: I6e01f577c935147ec91038b6dce115fcd893ac99
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Even though the buffer sice should be the same as the MTU it may actually
not be enough in case the headers are compressed so this adds a check if
there is enough space left to receive the decompressed data.
Change-Id: If8b4b5c2d7351b11a595a4b5f5364c78a19791f3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
For testing IPSP application against a Linux host it currently need some
extra steps since 6LowPAN is not enabled by default.
Change-Id: Id491e31ef9ad6eebca7497705e874c01a5493589
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This application uses Bluetooth IP driver to listen to UPD port and
echo back the data received.
Change-Id: Id8e58f5f8bf58ff5947441cbcb3131c0da27081c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This driver handles IPv6 traffic over Bluetooth LE connection.
The packet fragmentation is done inside BT stack, so this
driver only calls compression function.
Change-Id: Ib7f2356a1e88e78502239e54ef6e41f1f24ccd67
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is useful to detect if everything was sent properly.
Change-Id: If5ec891dc394d46b5ce8e011759ced4f3ecb5fb5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Some channels may required specific user data (e.g. IPSP) so even if
data is not segmented use alloc_buf callback to allocate a buffer if
supported.
Change-Id: Iecca4a6979da8bc6745ad5b3b214506d3dd71437
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Since we always do passive scanning and wait for a connectable
advertising event it makes sense to request continous scanning when we
issue the HCI_LE_Create_Connection. This way we minimize the risk of
loosing any advertising packets.
Change-Id: Ie314e15243aede00d1fb3be9532efb74518b293d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
By default all debugging should be off and only activated if
user really wants so.
Change-Id: I280748b7852052892c309d5f0ada611cb2bc08b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IP and L2 buffer debugging is now activated if one enables
CONFIG_NETWORKING_WITH_LOGGING option.
Change-Id: Idad4978cfd6bd705bdde6e21f1edcd3c7d280c75
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This patch adds structure definitions for SM related commands and
events. Structs are mapped with btp specification and will be used
within commands and events implementation.
Change-Id: I82231cdab62d170b86c548acc14ffdcbd888473a
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
There is no need for #if #else as BR/EDR enabled path is only special
case for LE connection. Also if there is return in if block else is not
needed.
Change-Id: Ie1a57a0e4dae6c4b79f64c14971b7e8ef009fca3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Make newline part of log macros so that caller doesn't have to
append '\n' every time logs are used. This make sure that no
log will be missing new line which results in concatenated log
messages.
Change-Id: I3231ae747c790816dbc1608e0a3bd56467ba0a1b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Selection of local IO capabilities based on registered auth
callbacks is different in legacy and LE SC pairing. With LE SC
we are able to use DisplayYesNo capabilities.
Change-Id: I5bb69cb962fa4ca6a89eb707fda76d46b2c99b1c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Adds routine to allow early initialization of connection object.
Change-Id: Icfa4a00732e631571a42dfd50f87b0779ea7f9a9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Adds helper routine to get connection object from available pool.
Change-Id: Ic6a7480bfbc35d297caceee3fd7eb53d6916b031
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Renames bt_conn_add() to bt_conn_add_le() to emphasize LE context.
Initializes link type to LE in early stage of setting LE connection.
Change-Id: Ica88764e1f3aba563ec7edc3b630e5e76ead249f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Those are debug feature and were enabled by mistake.
Change-Id: Id49078fd4b910578af35dbe8660d148a691a4f13
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Both legacy STK and LE SC LTK have rand and ediv equal to zero.
Comment that in code to avoid confusion if correct key is being
requested.
Change-Id: I00cbf7264659470226b5ceb28f9cce4ca6b0e2e4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
() Fix compilation errors due to variable ordering.
() Fix the default config for Quark/SE SS as
the kconfig options were renamed in previous
patches.
Change-Id: I1004ae332fb857b60ed90df59831e7bd9c490cb8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Tests errno is retrieved per-thread with fibers and one task.
Change-Id: I0b0890f250a80a30806dc1294944aa42f4209ace
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Provides proper access to the per-thread errno variable, by using the
_get_errno() call.
Users can now do:
errno = EINVAL;
printk("errno: %d\n", errno);
Change-Id: I0ef365199656d002623b39b7f45f14f561501375
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Saves an errno per-thread, retrieved via _get_errno(), instead of
changing the value of a global variable during context switches to avoid
a hit to the context switch performance.
Per-arch asm implementations are provided for maximum performance.
Enabled by default, but can be disabled via the CONFIG_ERRNO option.
Change-Id: I81d57a2e318c94c68eee913ae0d4ca3a3609c7a4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The 'pos' variable is only used within a very limited scope inside the
uart_console_isr() function. Move it's declaration there to avoid
having it exposed to the entire c-file.
Change-Id: I45ff0090ea4e0aabe77db2549d0194e26ebb63ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Most of the uart_console_isr() function is heavily indented. We can
remove one level by converting:
if (uart_irq_rx_ready(uart_console_dev)) {
...
...
}
to:
if (!uart_irq_rx_ready(uart_console_dev)) {
continue;
}
Change-Id: Ib2fe150490a8391de4001f29e4727431668853c4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>