Commit graph

624 commits

Author SHA1 Message Date
Mariusz Skamra 9e5854c16c Bluetooth: tester: Refactor adding attributes to the GATT database
This patch makes adding attributes more clean.
Attribute UUID and user data are now added along with the attribute
in gatt_db_add function. Thanks to that, some static variables have
been deleted, and the code is more readable.

Change-Id: I510bd7a1a9ae0210dd90520212a340ee1a3b2b53
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-07 18:21:52 +00:00
Andrew Boie b54355050d REVERTME: bluetooth: tests: disable some tests
bluetooth/shell and bluetooth/tester need to be disabled on
galileo and minnowboard respectively. On these platforms,
the IRQ for the UART console and the H4 are the same IRQ line.
IRQ_CONNECT() is being called on the same IRQ line twice, and
it's only through linker luck that these tests work at all
since one driver will "win" when the mapping is set up at build
time by gen_idt.

gen_idt was supposed to break the build in this situation but
was bugged. The next patch in the series fixes gen_idt.

Change-Id: Ib4a42b57181731121dfad50606c8362a9fd0277d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-03 10:24:25 +00:00
Mariusz Skamra 8a186d4eab Bluetooth: tester: Fix missing le to host order conversion
This fix missing conversion of CEP properties.

Change-Id: Ibdf9fecdb3e21e8fd5e2b7ccacb88ae2abd81776
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-03 08:18:39 +00:00
Mariusz Skamra 9055bfe58f Bluetooth: tester: Fix missing bit in GAP supported commands
GAP_CONNECT bit was missing in supported commands.

Change-Id: I9d009c55327ae67bed38c45b7c11fb67665e1cd0
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-02 11:38:00 +01:00
Mariusz Skamra c76bd33d61 Bluetooth: tester: Fix supported commands to use uint8_t array
Fixes endianess issues.

Change-Id: I9c308187d34a832cc875c9037235cedc8bee033c
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-02 11:38:00 +01:00
Mariusz Skamra 0abe6e85ba Bluetooth: btp: Fix BTP GATT command opcodes
This patch makes opcodes to be in the sequence.
Supported commmands is form now uint8_t array, so this resolves
the problem with endianess as well.

Change-Id: I602a58081948dbbf5e0d83cbb12a118a5990b9f8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-02 11:38:00 +01:00
Mariusz Skamra 084405c2c4 Bluetooth: tester: Remove set_ccc_value helper
CCC user data is already available on the initialization
(struct bt_gatt_ccc_cfg and ccc_cfg_changed callback).

Change-Id: Id06c69b6da33f651bc049983179cd6fe3bc197d6
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-22 10:09:50 +00:00
Mariusz Skamra e561f7c021 Bluetooth: tester: Refactor gatt_buf_add and gatt_buf_reserve functions
This removes a bit of redundant code.
gatt_buf_reserve can call gatt_buf_add with data set to NULL, to
reserve space on gatt_buf.

Change-Id: I533a515bbd022a07ba8e2bfb3cd07e1a9ff8878b
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-22 10:09:34 +00:00
Mariusz Skamra 9d862b2a61 Bluetooth: tester: Fix initialization of static variables
Static variables are already initialized to zero.

Change-Id: I8da4b6d93192f5534fbe55622c4ee890c0297de1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-22 10:09:16 +00:00
Mariusz Skamra cd272cadfb Bluetooth: tester: Use BT_UUID defines for UUID comparisons
Defined BT_UUID for the header can be used instead of struct member.

Change-Id: I55ca069d04622450e4fbb1e3f7abf6fdef2f8f30
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-22 10:09:05 +00:00
Johan Hedberg bab3b49fdb Bluetooth: Change GATT callback return values to ssize_t
Since the return value of these callbacks is a number of bytes ssize_t
is more appropriate than int.

Change-Id: I3406fb382975d62f51e7a195666d0ae88364fd2c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-20 15:39:33 +00:00
Johan Hedberg dfaafb204f Bluetooth: Use BIT() macro wherever possible
Instead of manually creating bit shifts for individual bits use the
BIT() macro that exists for this purpose.

Change-Id: I599ecc16b3a2cffe8a355e19816c405e51937e91
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-19 10:47:29 +02:00
Mariusz Skamra fc7bc7cffb Bluetooth: tester: Use common write without response command handler
There is no point having separate handlers for signed writes and
write without response commands because both call the same,
bt_gatt_write_without_response function.

Change-Id: Ib033ffb77e2123dd565e8f1119ef668253f810f9
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-18 11:41:11 +01:00
Johan Hedberg a72d967d33 Bluetooth: GATT: Expose ATT error codes to application callbacks
Introduce BT_GATT_ERR macro to make it possible for application
callbacks to return exact ATT error codes.

Change-Id: I971536508e75036fbddc40b3f33e5201e11940bc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-17 15:05:34 +00:00
Mariusz Skamra 89fbdeef9a Bluetooth: btp: Fix permission bits
This splits Authorization permission to Read with Authorization
and Write with Authorization.

Some attribites may be readable with no authorizarion, but writable
with authorization defined by a higher layer specification or be
implementation specific (eg. Server Characteristic Configuration
Descriptor).

Change-Id: I341a7095c1e8db1dea92cdeebf76c5a2307a49a1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-17 14:09:25 +00:00
Andrei Emeltchenko 92cd5c9529 drivers/nble: Decrease shell debug
Makes shell output readable by disabling extensive debug from UART
driver.

Change-Id: Ic8df252c8ca4abd6b021db11d266f4db80df4b09
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-16 15:44:32 +00:00
Szymon Janc ea085c4b47 tests: Fix Bluetooth tests and samples platform blacklisting
To exclude platform platform_exclude=foo should be used and not
platform_whitelist=!foo.

Change-Id: I4cddcd3b73e0bd8c42a0726776f8237ebd79a6ae
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-15 15:06:53 +00:00
Szymon Janc 3e00c7ad0e tests: Simplify test_bluetooth configuration
Use common config for tests and use testcase.ini for defining micro
and nano kernel variants.

Change-Id: I47453cd49696dd496cc728cc1eb2eba9cf7f1c6c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-15 12:57:57 +01:00
Szymon Janc c5d2e76048 Bluetooth: Merge init_h5 into init test
There is no need to have spearate app for H5 testing as init test can
use multiple configuration targets.

Change-Id: I467b5939ae914e7c1ac22fdac24d8b0b6ed3f1cf
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-15 09:40:30 +01:00
Anas Nashif 8afd0c993f samples: move bluetooth shell/init to tests
Combine both nano and micro tests and cleanup whitelisting
for the testcases to include all buildable boards.

Change-Id: I28d41b82fb60d75d4b172d9dd3ac7e71480053b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-14 19:25:31 +00:00
Johan Hedberg 1589a22650 Bluetooth: samples: Move init and shell to tests
The init, init_h5 and shell are not really samples but fit better in
the test category.

Change-Id: Id1a7ff31ad8767f858705bd952311cf64ff1f3f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-12 10:46:32 +02:00
Anas Nashif 8290b4c795 move include directory for tests cases to tests/
Make the test case routines reside under tests.

Change-Id: Iea59a68e8b537954250d63923a88df267639e716
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:08:08 +00:00
Anas Nashif 13b3727e6e tests: move kernel tests to tests/
Move all kernel testcases to tests/ and change Makefiles
accordingly where applicable.

Change-Id: I130cc3919174e93b7130d55fb101bed1d5d7552d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:06:33 +00:00
Anas Nashif 2e4de760be tests: move bluetooth tests to tests/
Move all bluetooth testcases to tests/ and change Makefiles
accordingly where applicable.

Also fix Makefile to make some variables overridable and reduce
level of whitelisting in testcase.ini.

Change-Id: Ia71ee1fbbb238c45280b1e3c4747ca2f748f5263
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:00:35 +00:00