A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We want to move to use a common FLASH_DEV_NAME across the various flash
drivers. So samples, tests, or other code can be a bit more generic. So
replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add conditional compilation and move code to support
building a non-connectable Bluetooth shell application.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixes many instances of errors similar to below:
zephyr/subsys/bluetooth/controller/ll_sw/ctrl.c:5927:22:
error: declaration of ‘s_link’ shadows a previous
local [-Werror=shadow]
static memq_link_t s_link;
^~~~~~
zephyr/subsys/bluetooth/controller/ll_sw/ctrl.c:5905:21:
note: shadowed declaration is here
static memq_link_t s_link;
^~~~~~
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixes the following compile error when building
tests/bluetooth/shell application:
In file included from subsys/bluetooth/shell/ticker.c:16:0:
subsys/bluetooth/shell/../controller/util/mayfly.h:21:2:
error: unknown type name 'memq_link_t'
memq_link_t *_link;
^~~~~~~~~~~
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.
Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.
This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.
For users that just want to continue their work with minimal
disruption the following should suffice:
Install CMake 3.8.2+
Port any out-of-tree Makefiles to CMake.
Learn the absolute minimum about the new command line interface:
$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..
$ cd build
$ make
PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Unless offset was specified, it should default to 0, whereas
previously, value from the last command was used.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.
Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This adds a second vendor service testing if service changed indications
works with more than one change in a row and as a bonus it implements
echo attribute which notifies any data that is written to it:
> ACL Data TX: Handle 3585 flags 0x00 dlen 9
ATT: Write Command (0x52) len 4
Handle: 0x0013
Data: 0000
< ACL Data RX: Handle 3585 flags 0x02 dlen 9
ATT: Handle Value Notification (0x1b) len 4
Handle: 0x0013
Data: 0000
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
With introduction of bt_gatt_service_unregister it is now possible to
unregister service at runtime.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fixed uninitialised auto variables, that had caused compile
errors under CONFIG_DEBUG=y.
Jira: Zep-2334
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Intention is to test flash driver along with BLE radio.
Added flash shell module with commands for erase, write-check, read and
co-operation with radio stress test.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Rename bt_gatt_unregister_service to bt_gatt_service_unregister to be
consistent with other APIs such as bt_gatt_service_register.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
gatt-unregister-service can be used to remove the test service at
runtime causing service changed to be indicated:
00:1b:dc:07:31:88 (public)> gatt-unregister-service
[bt] [DBG] gatt_indicate: (0x0011e100) conn 0x0011d880 handle 0x0008
[bt] [DBG] bt_att_req_send: (0x0011e100) conn 0x0011d880 req 0x0011db00
[bt] [DBG] att_send_req: (0x0011e100) req 0x0011db00
Unregistering test vendor service
< ACL Data TX: Handle 3585 flags 0x00 dlen 11
ATT: Handle Value Indication (0x1d) len 6
Handle: 0x0008
Data: 0a001000
> ACL Data RX: Handle 3585 flags 0x02 dlen 5
ATT: Handle Value Confirmation (0x1e) len 0
Jira: ZEP-2225
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fixed compile error due to the missing header file
dependency on bluetooth/hci.h, for bt_addr_le_t, in the
Link Layer header file.
Merge of PR #475 introduced the new dependency that broke
compilation after merge of #474.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Bluetooth Link Layer LE Advertising Extensions commands
for manual testing the feature during development. First one
being advx command to start non-connectable non-scannable
extended advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a repeat param to gatt-write-without-response so that
it covers what gatt-write-without-response-repeated was
doing. gatt-write-without-response was removed in the
commit 26eae70da.
gatt-write-signed too will have repeat param with this
change.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added shell module for the Bluetooth Controller's ticker
interfaces.
For now, info command enumerates active tickers' details.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This makes gatt-write-signed to reuse cmd_gatt_write_without_rsp since
it is quite similar and that adds the ability to send multiple octecs
instead of just a single byte.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes gatt-write-without-response-repeated and makes
gatt-write-without-response similar to gatt-write which was the
intention of gatt-write-without-response-repeated.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
All the files under shell subdir shall only be build if
CONFIG_BLUETOOTH_SHELL is selected.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
In order to properly queue request there need to be a bt_att_req
storage but none of the calls to gatt_write_ccc were using the params
causing gatt_send to use bt_att_send and not bt_att_req_send.
To fix this now all the callers of gatt_write_ccc do set the params
properly but this means that bt_gatt_unsubscribe has to wait for it
to be completed before the application can reuse the
bt_gatt_subscribe_params.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Both scan on and scan passive performed passive scanning,
fixed scan on command to use active scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This replaces the use of shell_register_prompt_handler with
SHELL_REGISTER_WITH_PROMPT which doesn't overwrite other modules
prompt.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If CONFIG_BLUETOOTH_GATT_CLIENT is not defined disable command that
would depend on it.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>