Commit graph

19237 commits

Author SHA1 Message Date
Szymon Janc
7f2de1dc7a Bluetooth: SMP: Make bt_smp_create_pdu static
This function is not used outside of smp.c file.

Change-Id: Ib2158330959f2b4b1d63695480e82ac506243ab8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:08 -05:00
Szymon Janc
68a4aebde4 Bluetooth: SMP: Move some code up in a file
Those will be used in legacy pairing code.

Change-Id: I311e10254a603c2b4cc46c50f6c3d27593a10bd7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:08 -05:00
Louis Caron
7fdb42a46f Bluetooth: add CPF descriptor support
In order to support more standard descriptors, the PF macro and helper
function are added.

Change-Id: I52db3c32f40f39b9c6bfdb9573d0a614d0f3295e
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:08 -05:00
Louis Caron
d566c3314b Bluetooth: add CUD descriptor support
In order to support more standard descriptors, the UD macro and helper
function are added.

Change-Id: Ic9a82658668107b40abc5c98002fe5091dc10f08
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
b90d2c6dbd Bluetooth: GATT: Pass bt_conn to the discovery function callback
This patch replaces bt_gatt_attr_func_t with bt_gatt_discover_func_t
to be used as a type of discovery callback. The reason is
bt_gatt_attr_func_t don't return bt_conn which could be used
later on to issue other commands and to application to know
from which connection this results come.

Change-Id: I1f26c72ad5c8a0b97485a337c7005d34281586d7
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
5ac044431e Bluetooth: tester: Handle Read Multiple Characteristic Values command
This patch adds Read Multiple Characteristic Values command handler
to the tester. It allows to test if GATT Client can read multiple
values from a GATT Server.

Change-Id: I994ffac73eb8e6c0a7696dc41304efd9f01c35a4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
c3ee5fbcdd Bluetooth: tester: Handle Write Long Characteristic/Descriptor command
This patch adds Long Write Characteristic Value/Descriptor command handler
to the tester. It allows to test if GATT Client writes long values properly.

Change-Id: I788707b0a043ecad6be32d9e1f8d536765ebf41a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
2f1e4e92e9 Bluetooth: tester: Handle Write Characteristic Value/Descriptor command
This patch adds Write Characteristic Value/Descriptor command handler
to the tester. It allows to test if GATT Client performs write
operation properly.

Change-Id: I3afe167c7ca2789df7d288bbc06ffc8479240da8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
b1c8d269ec Bluetooth: tester: Handle Read Long Characteristic/Descriptor command
This patch adds Read Long Characteristic Value/Descriptor command handler
to the tester. It allows to test if GATT Client can read long value from
a GATT Server.

Change-Id: I1c2060f7ecd45ca18ed5f9e0747121236b283631
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
4e04f912f1 Bluetooth: tester: Handle Read Characteristic Value/Descriptor command
This patch adds Read Characteristic Value/Descriptor command handler
to the tester. It allows to test if GATT Client can perform read
attribute value from a GATT Server.

Change-Id: If95b8d2d3a5a62048bb6371ae80b2834c20d88e1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
0e774613a4 Bluetooth: tester: Handle Signed Write Without Response command
This patch adds Signed Write Without Response command handler to the tester.
It allows to test if GATT Client can perform signed write operation without
acknowledgement form Server.

Change-Id: I14757e6a52abf87bed68103b2e6fbff200fb6bb8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
51de714eef Bluetooth: tester: Handle Write Without Response command
This patch adds Write Without Response command handler to the tester.
It allows to test if GATT Client can perform write operation without
acknowledgement form Server.

Change-Id: I3663e2e01c0fabfd75e4bedab0955700e3003522
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:08 -05:00
Mariusz Skamra
66cc8faf7a Bluetooth: tester: Handle Discover All Characteristic Descriptors command
This patch adds Discover All Characteristic Descriptors command handler
to the tester. It allows to test if GATT Client can perform discovery of
characteristic descriptors within specified range.

Change-Id: Ieb04b47168249d8d76eab840b4f54b8b6b450792
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
2d1b3b5a62 Bluetooth: tester: Handle Discover Characteristics by UUID command
This patch adds Discover Characteristics by UUID command handler
to the tester. It allows to test if GATT Client can perform discovery
of characteristics based on known UUID.

Change-Id: Iab78ea7e5bc85e1fadc46b7e8f5b28ee4b9db16d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
b01cc79923 Bluetooth: tester: Handle Discover All Characteristics command
This patch adds Discover All Characteristics command handler to the tester.
It allows to test if GATT Client can perform discovery of all
characteristics contained within specified range.

Change-Id: Ib70abaf1365fe4a73757507148723e66881b01de
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
469ea4ee10 Bluetooth: tester: Handle Find Included Services command
This patch adds Find Included Services command handler to the tester.
It allows to test if GATT Client can perform relationship discovery.

Change-Id: I76c12fcd5e79d906b4e29b926a82a2022e505c40
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
ee178fe665 Bluetooth: tester: Handle Discover primary services by UUID command
This patch adds Discover Primary Services by UUID command handler
to the tester. It allows to test if GATT Client can perform discovery
of primary services based on known service UUID.

Change-Id: If5788c6f23481c7b4af85834bf8b113a97a4b66d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
a693d9f29c Bluetooth: tester: Set missing bits in GATT supported commands
This patch fixes missing bits set in GATT supported commands.

Change-Id: I0c8035dc126a680147978947438f28df3b734d7a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Louis Caron
be72f6d197 Bluetooth: UUID: Add the SCC UUID
Change-Id: I5b9d3ef5745be46b5453e1c5b90fe4dc05d76073
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:07 -05:00
Louis Caron
12f40ebd8c Bluetooth: GATT: Fix small typo
Change-Id: Ie70354e9b80db5b6a08fe639d1e3393df6294115
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:07 -05:00
Andrei Emeltchenko
a8c042827a Bluetooth: Correct headroom calc for outgoing packet
Needed headroom depends on type of the UART driver, change it
accordingly.

Change-Id: Ic9bf5f08a49be6823fce5eff8139d5f949b313ca
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:07 -05:00
Andrei Emeltchenko
54c0790b1f Bluetooth: Improve error message printed
Include expected opcode to print together with received opcode.

Change-Id: Iacc73c12f22fe0585e2753d709646bacd3e73d32
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:07 -05:00
Andrei Emeltchenko
cc7349b2d8 Bluetooth: Replace fiber_fiber_ with fiber_
We use fiber_delayed_start() for starting delayed fiber. Make use of
fiber_delayed_start_cancel() instead of
fiber_fiber_delayed_start_cancel().

Change-Id: I2399290496ed2a2b21b2a780d884881839f36767
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
c8dbc71552 Bluetooth: tester: Add passkey entry command implementation
This adds implementation of passkey entry command in tester
application.

Change-Id: I0624ee9f899102284490a82f5bb0a68bb342640a
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
cc795e9204 Bluetooth: tester: Add pair command implementation
This adds implementation of pair command in tester application.

Change-Id: I55545bdf99e2828c17ec716069e925940f15d019
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
b6c0a04a55 Bluetooth: tester: Add set io cap command implementation
This adds implementation of setting io capabilities command in tester
application.

Change-Id: I21ae68633fb74d78db6e5622e1ee518ef0eed632
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
434a4f6d85 Bluetooth: tester: Implement SM command stubs for tester
This patch adds stubs for SM commands defined in GAP.

Change-Id: I5aef256ade5a100eb0a582c5d9bd5eb8d01611f2
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
2c14807046 Bluetooth: tester: Separate helper for converting to btp addr type
This patch separates helper for converting address type to btp
specific.

Change-Id: Ied723e01f5548b10e063a6771f8824c0c35b4682
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Grzegorz Kolodziejczyk
c0c7358196 Bluetooth: tester: Replace tester_rsp_full wrapper with tester send
This patch removes redundant tester_rsp_full public function with
wrapped tester_send function.

Change-Id: Iba517ed194e02045ca952b00b952c7608592fbbd
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:07 -05:00
Szymon Janc
873cbfb470 Bluetooth: Kconfig: Move SMP related option under BLUETOOTH_SMP
This makes menuconfig easier to navigate.

Change-Id: Ica49bbbde73c785f218846380fd46d5463424890
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:07 -05:00
Mariusz Skamra
d82d735079 Bluetooth: tester: Fix blocking ATT requests
BTP Client received success response from the tester application too early,
so that next command was blocked due to pending ATT Request

Change-Id: I598c0e9e90984cac07f8b4ea265b0d6d69d3d18d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:07 -05:00
Szymon Janc
3670e7fcd0 Bluetooth: SMP: Minor codestyle fix
Change-Id: I115fda172698881c69ed301e5f729bb32c1cb978
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:07 -05:00
Szymon Janc
755130ad68 Bluetooth: SMP: Fix setting ediv and rand for LE SC LTK
Change-Id: Ic8867a510864a8cfb30af30c505d25faa91c2fb7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
7493cadee7 Bluetooth: Reduce hci_cmd_complete() stack usage
Instead of storing a pointer to the status (4 bytes) we can just copy
its value directly (1 byte). Since the previous variable is a 16-bit
opcode the smaller 1-byte variable should fit within the same 4-byte
word, saving 4 bytes from the stack.

Change-Id: I406c60c7b2563ba6397ab75cf1dbe3d346b6c0ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:07 -05:00
Luiz Augusto von Dentz
4a20bc14a7 Bluetooth: Make use of BT_UUID_DECLARE_16 for services
This makes it simpler to add the services directly into GATT services
table.

Change-Id: I090c7f9396329cf524947dd6647230c663a55f60
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:07 -05:00
Andrei Emeltchenko
2e97cbc55b Bluetooth: trivial style correction
Change-Id: Ib9069e2698614a3f5bb4bc9382aa5d458f007d95
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
401fccf7ce Bluetooth: log: Remove redundant 'bt:' prefix from assert
BT_ERR() already inserts the bt: prefix.

Change-Id: I7feda0e28caad4f0e1f18e5d9099fa21684e4b35
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
30e0e64407 Bluetooth: Add color logging support
Add basic color logging support. Error logs will be printed in red
whereas warn() logs in yellow. The support is behind a Kconfig option
in case someone needs to build the stack for a terminal that doesn't
support the ANSI color codes.

Change-Id: I080e32db68f87e81f1bb54aa4c634f7cd38f1e33
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
5d80ae929c Bluetooth: Rename NO_DRV to more consistent NO_DRIVER
Change-Id: I30b89607446c9a9926411b5fb210460d076369b1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
b9c8afb353 Bluetooth: Rename DEBUG_UART to more generic DEBUG_DRIVER
Change-Id: I6a47f7579be233d1bcdf01dc9af57f6da62ef75c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:07 -05:00
Johan Hedberg
486167fdee Bluetooth: Kconfig: Remove redundant dependencies
Change-Id: I41013cbea2ec78157b9c5551c3aabecc2daa24a1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:06 -05:00
Javier B Perez Hernandez
f55fefe3d0 compare footprint: added error counter and error message for sanity.
Added error log when base or current commit cannot be built.
Removed exit(1) when there are deltas, deltas should not be consider as errors.

Change-Id: I182edab83be14f642086818a9df0be96d8d4ae09
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:25:06 -05:00
Anas Nashif
33ce2c7011 quark_se: quark_d2000: do not set native drivers as default
Allow usage of alternative drivers and do not hardcode drivers
to zephyr own implementation.

Change-Id: Ieb55b5dc88b3643f276b7c48facef7f1c1c42fa7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:06 -05:00
Anas Nashif
8704792c45 grove_lcd: this display is not a feature of the board
The LCD display is an add-on, not a feature of the platform or the
board.
Set the defaults and remove the definition from Galileo Kconfig.

Change-Id: Ic319cd765d2dc1fe08cc65615680821fe9bc6a83
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:06 -05:00
Daniel Leung
cbd7dc65c4 quark_se_ss: enable UART
On Arduino 101, the sensor subsystem also has access to the two UARTs
on board. So this adds the necessary code to enable them to be used.
However, one needs to make sure only one core has access to one UART
at the same time.

Change-Id: I9f6c203916164d1b48559a9752fb1e4d879d7fa4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:06 -05:00
Daniel Leung
6a869058ff samples/gpio_dw: extends the app for GPIOs on quark_se_ss
The basic is the same for both architecture, but using different
GPIO controller and pins.

Change-Id: Ie021461858736d90a47bdef2c9d5e655e2efa473
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:06 -05:00
Daniel Leung
5aab5ccbad arc/quark_se_ss: need some magic to enable GPIO interrupts
1. Need to unmask interrupts for the sensor subsystem.
2. The GPIO controllers need their clock enabled before they can
   start sending out interrupts.
3. Setting up ISR on ARC requires usage of irq_connect().

Change-Id: I633b07292f11e5c5e768fc51fabb70769d407609
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:06 -05:00
Daniel Leung
ceb1869bcc arc/quark_se_ss: update GPIO0/GPIO1 interrupt number
The interrupt number for GPIO0/GPIO1 are 20 and 21 respectively.
The old value of 8 refers to the interrupts line on the x86 side
of GPIO controller.

Change-Id: I2e9e061d3506e27cb7b14e0431c3b6201a50aad4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:06 -05:00
David Antler
a99b90e4da Fixed Galileo UART0_RXD muxing bug
The pin mux for Galileo Gen2 isn't set properly to enable UART0_RXD input from
the Arduino headers. EXP1's pin0 OE_N needs to be set HIGH to make the IO0
buffer an Input.

Change-Id: I0167f11ff5ee87bd5afe17300807b1aa4ed17abf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: David Antler <david.a.antler@intel.com>
2016-02-05 20:25:06 -05:00
Andrew Boie
689ec02211 x86: mvic: fix IDT reload
The argument to 'lidt' is a chunk of memory with the base address
and limit of the IDT, and not the IDT itself. Horrible things
were happening when the IDT itself was being passed to this
instruction.

To be extra safe, disable interrupts while we modify the table
and subsequently reload it.

Change-Id: I9bf96f13a5f6e1be80d11bbfb9db3df1f2ed613a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:06 -05:00