This patch adds missing packed attribute to structures.
Change-Id: I9bcc8a677ae296e41eebb530584977660df52ebf
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
SMP timer should be restarted every time SMP PDU is send. To avoid
such issues in new code provide smp_send() helper that will always
restart timer. Only exceptions are Security Request and Pairing Failed
commands as those don't restart timer.
Change-Id: I96a7cd72b2249d25d1c3f9e8b3fbf1e74dc76222
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no point in going with pairing any further regardless of when
bt_smp_dhkey_ready was called.
Change-Id: I0e0c71e91ecf36f74b429d9455a2f21161939069
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
smp_reset is always called after Pairing Failed was sent so just
move it inside this function. This makes sure that new code won't
be missing reset after error. Also rename send_err_rsp to smp_error
as it now accept smp context instead of conn.
Change-Id: I25cdca066817f79f6c2f83d9f9bd0876b7909085
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If Pairing Failed was send we should reset SMP context to be able to
restart pairing if needed.
Change-Id: Iea524ccf841ceba8a1194d94ead9c7256331ad14
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This flag means that DHKey check should be generated and send on
next event.
Change-Id: I0dc9aa3713ad17ceabc4f5f890afa32f538f714f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Don't generate error response for invalid offset or invalid
attribute value during queued write requests.
According to BT SIG specification such response needs to be done when
execute write request is performed.
Change-Id: If480228dc98f5713891b45b3f5ca31990cf5c633
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
request_tk is called only for legacy pairing. Due to this pairing
method must be selected in pairing request or response handler to
cover LE SC case. But it must be selected only after it is known if
pairing is legacy or LE SC.
Change-Id: I0418a679b73c199acff12795157389d5969adb05
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If both sides have KeyboardDisplay capabilities Passkey Confirmation
should be used.
Change-Id: I69d0909831cab0340ecbb418f035414b18e8c0c0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Both of the br_init() functions should be checking for BR/EDR support
before issuing the commands. To not have to code the check twice, do
it in hci_init() before calling br_init().
Change-Id: I2de3aa3c2e85322257b27b1c716b37c326d5bae7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch extends Bluetooth Testing Protocol with commands used
while testing IUT as GATT client.
Commands are mapped to the procedures from Core Specification to make
use of Read Supported Commands command. Based on the response to this
command tester can determine which PTS test cases should be enabled.
If the IUT don't support eg. Reliable Writes, this command won't be
set in Read Supported Commands response, so that test cases that
test this functionality won't be executed.
Change-Id: I204a295698d4b69f73d0556b172770c4fd018009
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Uses dedicated initializing routine to start getting controller's
internal buffer capabilities. At first initialize ACL packet length
(MTU) with max value controller can accept.
Change-Id: If90dd16ebb5c0751fb65555b06c9fb18ed394a54
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Defines instance for controller specific information.
Prepare room for max ACL packet length controller can get.
Change-Id: I5fb5f83b3f7383337b6b86683dff05b675815b98
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Moves initialization of bt_dev.le.pkts_sem object to handlers reading
controller buffer capabilities. Therefore no need to keep anymore
bt_dev.le.pkts member.
Change-Id: I126cb1d9ad9feed9c11f35b26c44055075734685
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Buffer size is 512, so uint16 type shall be used to store it's length.
Change-Id: I5abaf7d783032ff41819f7b838d4016932dece20
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This patch separates helper for converting uuid received from btp
command to bt_uuid.
Change-Id: If7f5423a839379763928ba5e87678697b1721d83
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This removes extra zero buffer and reuses l as initial zero buffer.
This reduces stack usage from:
rx stack (real size 1024): unused 96 usage 896 / 992 (90 %)
to
rx stack (real size 1024): unused 112 usage 880 / 992 (88 %)
when using LE SC.
Change-Id: I961e4270f7b86b6d2615e23d6ace9cc81026eaf7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Follow unix convention of foo(dst, src, len). This makes code
easier to read.
Change-Id: I1f8a2638e87d060dcf84f5a7074e0b734d4ea4f0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If P256 key is present use it to start encryption instead of starting
new pairing.
Change-Id: I7c8541359a785e6e22e63cdab5a92a402db83db3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If LE SC P256 key is available use it to encrypt link.
Change-Id: I21790d6641748f34aba4058beb424bd56793713c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This run smp_f6 function with test vectors from Core Specification 4.2.
Change-Id: I6a29be3c8f90ca787d90c957cb6667853e823002
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This implements LE SC f6 function use to calculate DH Key checks
values. Calculated value is compared to value received from remote
party and if match encryption is enabled.
Change-Id: Iee66cbd19c0aa6d83edc6482dfb87943e4e45069
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
When remote Public Key is received issue HCI command to calculate
DH Key.
Change-Id: I46ce03d6a8aafebaad2656ccf66cbb636ceb748a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This run smp_f5 function with test vectors from Core Specification 4.2.
Change-Id: I1ef0ddf54c058bd7a9b7cc635fd785267a1bafd8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This implementes f5 function and use it to generate LTK and
MacKey.
Change-Id: I86d9a958d5009796ea04f2447e1bad9eb63981ce
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This run smp_f4 function with test vectors from Core Specification 4.2.
Change-Id: If083d8c9c81b98af97ed900db2004482b3e886e3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This adds initial pieces for LE SC support including pairing method
selection, authentication field updates, confirmation generation and
public key sending.
Change-Id: I91dcd0058c8f45ea19df89c2336142d927b08235
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This is needed for LE Secure Connection when tinycrypt is not used.
Change-Id: Ia0419da882d48d9d298b6674803b2e4987e6aa0c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
We don't use "Bluetooth Smart" anywhere, so we shouldn't use
"Bluetooth Classic" either. Instead, stick to the more technical "LE"
and "BR/EDR" terms.
Change-Id: Iadfc1c090205e0f417081d63ebe43172c5708a18
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
IUT shall response with Invalid Offset ATT error code, if it exceeds
value length.
Change-Id: I5c7148c96324482f198332d475742bfb44274957
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Indicate to the user that the debug support is no longer LE-specific
but generic for Bluetooth subsystem.
Change-Id: I1a1c39fd03bf857ba673fbb5d15fa50ffba02afa
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This allows to store LE SC keys. Since LE SC and legacy
pairing are mutually exlusive there is no need for additional
storage space as keys.ltk can be used for it.
Change-Id: I784e670684e9047b4b90b8cb8505d9b581c47b50
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
The least significant bit of opcode is not used to distinguish between
command/response or events.
Change-Id: Icaa1b6d87968e095a7f231d43e74257f5acca379
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Add configuration files for new platform and adapt options
of the benchmarks for those platforms.
Change-Id: I7c5011966c3a99f0b1c2c3fc44ba05b67ac6f953
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This test requires a huge stack and wont fit on Quark SE.
Generated binary is too large due to a large stack size defined.
Change-Id: I3446d614a58db1ab78941799ee41e898368db3b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This sample depends on functions that are not available in
the MVIC driver.
Disabling while we wait for those to be implemented.
Change-Id: Icd03ef014cbcd890945c0e77e349cccfded62e22
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will allow tests to be built for this platform.
Change-Id: I2275ec71af6cdb6f71c131fa26c5eae2d91c2475
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
The Intel Quark microcontroller D2000, is a low power, battery-operated,
32-bit microcontroller. Within its small footprint, the Intel Quark
microcontroller D2000 includes an Intel Quark ultra-low-power core
running at 32 MHz, with 32k integrated flash and 8k OTP SRAM.
Change-Id: I6ba121996edb0b5fbe596bd6ef3d6e3979ff73e9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This module is based on the standard Local APIC and IO APIC source modules.
This modules combines these modules into one source module that exports the
same APIs defined by the Local APIC and IO APIC header modules. These
routine have been adapted for the Quark D2000 Interrupt Controller which has
a cutdown implementation of the Local APIC & IO APIC register sets.
Change-Id: Ic80aa78918483663d76054ebadefa08d8a3f188a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>