Commit graph

217 commits

Author SHA1 Message Date
Luiz Augusto von Dentz 090f95d2ba Bluetooth: Shell: Add option UUID parameter to GATT show-db
This enables locating specific attribute in the database:

uart:~$ gatt show-db 0x2a00
attr 0x004235a8 handle 0x000b uuid 2a00 perm 0x09

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz 26fea23435 Bluetooth: shell: Make show-db print the total number of attributes
In addition to just print each attribute this also include the total
number of attribute and how much the database consumes:

uart:~$ gatt show-db
attr 0x00423460 handle 0x0001 uuid 2800 perm 0x01
attr 0x00423474 handle 0x0002 uuid 2803 perm 0x01
attr 0x00423488 handle 0x0003 uuid 2a05 perm 0x00
attr 0x0042349c handle 0x0004 uuid 2902 perm 0x03
attr 0x004234b0 handle 0x0005 uuid 2803 perm 0x01
attr 0x004234c4 handle 0x0006 uuid 2b29 perm 0x03
attr 0x004234d8 handle 0x0007 uuid 2803 perm 0x01
attr 0x004234ec handle 0x0008 uuid 2b2a perm 0x01
attr 0x00423580 handle 0x0009 uuid 2800 perm 0x01
attr 0x00423594 handle 0x000a uuid 2803 perm 0x01
attr 0x004235a8 handle 0x000b uuid 2a00 perm 0x09
attr 0x004235bc handle 0x000c uuid 2803 perm 0x01
attr 0x004235d0 handle 0x000d uuid 2a01 perm 0x01
attr 0x004235e4 handle 0x000e uuid 2803 perm 0x01
attr 0x004235f8 handle 0x000f uuid 2aa6 perm 0x01
attr 0x0042360c handle 0x0010 uuid 2803 perm 0x01
attr 0x00423620 handle 0x0011 uuid 2a04 perm 0x01
=================================================
Total: 2 services 17 attributes (476 bytes)

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz 09c06a1232 Bluetooth: Shell: Convert users of hexdump to shell_hexdump
This replaces the use of hexdump with shell_hexdump and removes the
former.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Jim Paris 7cdfe7f26f Bluetooth: shell: fix build warning if !BT_CENTRAL
Fixes:
  .../zephyr/subsys/bluetooth/shell/bt.c:906:12:
     warning: 'cmd_chan_map' defined but not used [-Wunused-function]

Signed-off-by: Jim Paris <jim@jtan.com>
2019-04-08 12:36:15 +03:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Carles Cufi 42fcaf2df4 Bluetooth: shell: Add missing include path
When building ticker.c from the shell, it requires include access to the
Nordic HAL, so add the relevant folder to the include path.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-26 10:18:59 -05:00
Jakub Rzeszutko 41ad9b716c shell: fix command bt scan
Command scan fixed in the way that it can take one mandatory parameter
and one optional. Previously it accepted only 2 mandatory parameters.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-03-25 20:38:35 +02:00
Jakub Rzeszutko 4557b6b2d1 shell: removed dead code in bt command
Removed automatic argument count checking in bt command. Now
it is possible to print a message that extra argument is not
recognized.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-03-25 20:38:35 +02:00
Jakub Rzeszutko b6fc1af6ba shell: unify bt commands return value
Repleaced magic number 1 with define SHELL_CMD_HELP_PRINTED

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-03-25 20:38:35 +02:00
Flavio Ceolin 23e75c1492 bluetooth: shell: Fix uninitialized variable
Variable evt_prop could be used without being initialized. This problem
was spotted by coverity.

CID 190970

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-01 09:19:31 +01:00
Krzysztof Chruscinski 3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Carlos Stuart 75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Vinayak Kariappa Chettimada 85d92923e2 Bluetooth: controller: Rename non-Kconfig option macros
Remove CONFIG_ prefix from non-Kconfig macro definitions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-02-13 09:20:26 -05:00
Vinayak Kariappa Chettimada 4c77bf6194 Bluetooth: controller: Remove redundant tmp role implementation
Remove the redundant proof of concept template temporary
role implementation from the repository.

Relates to #12860.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-02-05 15:00:08 +01:00
Vinayak Kariappa Chettimada 5478e82993 Bluetooth: shell: Updates related to new ULL LLL architecture
Updates related to new ULL LLL controller architecture.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-23 09:45:06 +01:00
Vinayak Kariappa Chettimada 254a97af93 Bluetooth: controller: Preliminary work in progress mesh ext.
Preliminary work done towards Mesh extensions on the old LL
architecture implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-23 09:45:06 +01:00
Luiz Augusto von Dentz 478b6b5381 Bluetooth: Shell: Add write-without-response-cb command
This adds write-without-response-cb command which can be used to
confirm the transmission of the PDU using bt_gatt_write_without_rsp_cb.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-16 21:43:53 -05:00
Johan Hedberg a886229c2b Bluetooth: shell: Fix incorrect indentation
This line was indented using four spaces instead of a tab.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-11 15:27:38 +02:00
Wenjie Xu ce43d428c0 Bluetooth: shell: Fix NULL shell context
On bt_ready, ctx_shell would be NULL if not initialized before
bt_enable.

Signed-off-by: Wenjie Xu <xuwenjie@huantengsmart.com>
2019-01-10 11:56:07 +01:00
Vinayak Kariappa Chettimada dfe415a912 Bluetooth: shell: Changes related to controller split preparation
Changes to Bluetooth shell application related to the
controller split architecture preparation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-07 13:42:01 +01:00
Vinayak Kariappa Chettimada 87fe440f01 Bluetooth: controller: Prepare to introduce LL split architecture
Preparation to introduce the Upper Link Layer (ULL) and
Lower Link Layer (LLL) split architecture.

- Move SoC dependent HAL to vendor specific folder.
- Preparation to split data structures into ULL and LLL
  types.
- Added more role and state conditional compilations.
- Added some work-in-progress implementation of advertising
  extensions, will be used as inspiration in the new split
  architecture work.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-07 13:42:01 +01:00
Jakub Rzeszutko f0b19181e0 bt_shell: fix command bt advertise valid argument count
Changed number of valid arguments from two required to
one required and one optional.

Command can be called with required <type: off, on, scan, nconn>
and optional <mode: discov, non_discov>".

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-18 18:52:00 +02:00
Jakub Rzeszutko b928b71756 shell: rename shell_help_print function
Function printing help has been renamed to shell_help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 3064ca4f2f shell: creating new module for help functionality
1. Created new shell module: shell_help.
2. Simplified command handlers with new shell print macros.
3. Removed help functions from command handlers.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 5451ff2848 shell: remove "options" concept
Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Patrik Flykt b97db52de7 misra-c: Add 'U' to unsigned variable assignments in subsys/
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Luiz Augusto von Dentz 67e4710598 Bluetooth: shell: Make use of SHELL_CMD_ARG
Use SHELL_CMD_ARG to register commands.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-13 20:42:01 +02:00
Luiz Augusto von Dentz b7c6ea4971 Bluetooth: shell: Remove macros to print messages
Make use of shell_print and shell_error now that they are available.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-13 20:42:01 +02:00
Luiz Augusto von Dentz 4add794570 Bluetooth: shell: Remove auto selecting of SERIAL
This is no longer needed and the shell itself will take care of
selecting SERIAL.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-13 20:42:01 +02:00
Luiz Augusto von Dentz 75979397b2 Bluetooth: shell: Fix illegal access
BT_LE_ADV_CONN_DIR_LOW_DUTY declares a local variable so it cannot go
out of scope, so instead of assigning in the scope of the if statement
this rework the code to mantain the declaration in the same scope it is
used.

Fixes #10570

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-09 16:18:44 +02:00
Johan Hedberg 97141734f1 Bluetooth: shell/gatt: Fix unreachable code
The code had somehow gotten corrupt (yet in a way that it compiles) so
that an intended if-branch was missing.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:29:51 +02:00
Mariusz Skamra 74318e61ca Bluetooth: Change l2cap accept callback return error
This changes EKEYREJECTED to EPERM due to newlib dependencies
errors.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-10-26 16:56:01 +01:00
Mariusz Skamra c04b70469b Bluetooth: shell: Add possibility to reject L2CAP CoC conn request
This adds a possibility to reject incomming LE Connection request
due to insufficient authorization or encryption key size.
This is needed for qualification purposes

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-10-25 08:02:54 +01:00
Satya Bhattacharya 6063707662 bluetooth: shell: Uninitialized scalar variables
Initialize variables chan_map in bt.c
Pass NULL and 0 directly to bt_le_adv_start()
Coverity-CID: 188735
Coverity-CID: 188729

Fixes #10588 #10594

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-10-21 15:09:54 +03:00
Johan Hedberg 343c53e841 Bluetooth: Switch from SYS_LOG to logger-based logging
Initial conversion to use syslog instead of logger.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Jakub Rzeszutko 147122e77f shell: examples unification
Updating examples according to new return value of function
shell_cmd_precheck.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-19 13:35:56 +02:00
Anas Nashif 3aa2a1c6db flash: make flash shell generic
This shell command was tied to bluetooth and the bluetooth shell and
also had messages all related to nordic ICs.
Make it generic and put it under drivers/flash/ so it can be included by
anyone and independently of bluetooth.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-19 11:49:18 +02:00
Alberto Escolar Piedras 5f39dbb1b0 Bluetooth: Use new nrf COMPATIBLE options
To allow the BLE stack to be used both in the real nRF platforms
and simulated ones, change the used macros in the code to the
COMPATIBLE ones.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-15 09:36:37 -04:00
Radoslaw Koppel 152b15ab3b subsys: bluetooth: shell: bt: Add command to show LL address
This commit implements command in the shell to show current
link layer address.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-10-04 10:35:06 +02:00
Luiz Augusto von Dentz 76714c1480 Bluetooth: Shell: Make error message for unknown parameter consistent
Also simplify it by having the 'unknown parameter:' as part of the
message format.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-03 09:49:58 +02:00
Luiz Augusto von Dentz ba545e0d3c Bluetooth: shell: Fix using \n with print/error
Those macros already contain line termination.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-03 09:49:58 +02:00
Carles Cufi 990ab2de70 Bluetooth: shell: Transition flash.c to the new shell
Convert the flash.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
Carles Cufi 63f4d9f509 Bluetooth: shell: Transition ticker.c to the new shell
Convert the ticker.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
Carles Cufi 5372950336 Bluetooth: shell: Transition ll.c to the new shell
Convert the ll.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
Jakub Rzeszutko 0eea1ef212 subsys: shell: add int ret_val to command handlers
1. Command handler can return command exectution status as int.
2. Existing command handlers rework.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Luiz Augusto von Dentz 17558c9382 Bluetooth: shell: Use \r\n to terminate line
Shell expects each printed lined to be terminated with \r\n.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz fb4785d274 Bluetooth: shell: Split L2CAP commands
This splits L2CAP commands under 'bt' to 'l2cap' removing 'l2cap-'
prefix from the commands:

l2cap - Bluetooth L2CAP shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  connect     :<psm>
  disconnect  :[none]
  metrics     :<value on, off>
  recv        :[delay (in miliseconds)
  register    :<psm> [sec_level]
  send        :<number of packets>

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz 043a8b0202 Bluetooth: shell: Split GATT commands
This splits GATT command under 'bt' to 'gatt' removing 'gatt-' prefix
from commands:

gatt - Bluetooth GATT shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  discover-characteristic  :[UUID] [start handle] [end handle]
  discover-descriptor      :[UUID] [start handle] [end handle]
  discover-include         :[UUID] [start handle] [end handle]
  discover-primary         :[UUID] [start handle] [end handle]
  discover-secondary       :[UUID] [start handle] [end handle]
  exchange-mtu             :[none]
  read                     :<handle> [offset]
  read-multiple            :<handle 1> <handle 2> ...
  subscribe                :<CCC handle> <value handle> [ind]
  write                    :<handle> <offset> <data> [length]
  write-without-response   :<handle> <data> [length] [repeat]
  write-signed             :<handle> <data> [length] [repeat]
  unsubscribe              :[none]
  metrics                  :register vendr char and measure rx
			    [value on, off]
  register                 :register pre-predefined test service
  show-db                  :[none]
  unregister               :unregister pre-predefined test service

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz bcfc9939e4 Bluetooth: shell: Split RFCOMM commands
This splits RFCOMM command under 'br' to 'rfcomm' removing 'rfcomm-'
prefix from commands:

rfcomm - Bluetooth RFCOMM shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  register    :<channel>
  connect     :<channel>
  disconnect  :[none]
  send        :<number of packets>

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz 310ffc4c4c Bluetooth: shell: Split BR/EDR commands
This splits BR/EDR command under 'bt' to 'br' to reduce the command
list and at same time cleaning the mix between different bearers.

In addition to that also remove "br-" prefix for the commands:

br - Bluetooth BR/EDR shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  auth-pincode       :<pincode>
  connect            :<address>
  discovery          :<value: on, off> [length: 1-48] [mode: limited]
  iscan              :<value: on, off>
  l2cap-register     :<psm>
  oob                :
  pscan              :value: on, off
  sdp-find           :<HFPAG>
  rfcomm-register    :<channel>
  rfcomm-connect     :<channel>
  rfcomm-send        :<number of packets>
  rfcomm-disconnect  :[none]

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz 592dd2e964 Bluetooth: shell: Port commands to the news shell
Fixes #8873

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz 8c02af73be Bluetooth: shell: Add l2cap-recv command
This adds l2cap-recv which can be used to set a delay when confirming
the receptions of packets:

> l2cap-recv 1000
Incoming conn 0x00401c20
Channel 0x004220c8 connected
Channel 0x004220c8 requires buffer
Incoming data channel 0x004220c8 len 230
00000000 00 00 00 00 e6 00 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000010 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000020 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000030 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000040 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000050 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000060 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000070 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000080 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000090 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000a0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000b0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000c0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000d0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000e0 7f 7f 7f 7f 7f 7f
Delaying response...
Confirming reception

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 3151d26572 Bluetooth: L2CAP: Add return to recv
This adds a int return to recv callback which can be used to notify the
stack about errors when receiving a packet. In addition to that the user
can return -EINPROGRESS to inform the stack the data will be processed
asynchronously which can be complete by calling
bt_l2cap_chan_recv_complete.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Krzysztof Chruscinski 527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Joakim Andersson 9c2214e2a3 Bluetooth: shell: Add shell command set channel map
Add a new command in the shell which can be used to set the channel
map by specifying a 37 bit bitmask written as a five byte hex array.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-09-19 15:51:57 +03:00
Mariusz Skamra 323243d376 Bluetooth: Add a shell command to disable bondable mode
This adds a shell command for qualification purposes to enable/disable
Bonding flag in Authentication Requirements.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-09-19 10:48:39 +03:00
Luiz Augusto von Dentz f67d45609e Bluetooth: shell: Fix requiring UUID for gatt-discover
This enables using these commands to perform discover all procedure:

> gatt-discover-primary
 Discover pending
 Service 1800 found: start handle 1, end_handle 5
 Service 1801 found: start handle 6, end_handle 9

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-19 09:23:08 +03:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Kamil Piszczek 3e8f118d8f Bluetooth: shell: adding command for directed advertising
Added a new command, which can be used to test the directed advertising
API. This command allows user to turn on directed advertising in two
modes: low and high duty. High duty mode is the default one.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2018-09-13 14:21:21 +02:00
Johan Hedberg 61ec51251e Bluetooth: shell: Add id-delete command
Add a command to test the new bt_id_delete() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Johan Hedberg 7ec40e81d0 Bluetooth: shell: Add multiple identity support
Add shell support for creating and showing identities.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Johan Hedberg 5708f1e8b1 Bluetooth: Add infrastructure to handle multiple identities
Make it possible to have multiple identity addresses as an LE
peripheral. For central role only the default identity is supported
for now. This also extends the flash storage in a backward compatible
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Johan Hedberg 0ab27e6803 Bluetooth: shell: Add support for pairing confirm-only callbacks
Add a callback struct with only the pairing_confirm authentication
method. This is useful both for just-works testing as well as the
recently added fixed passkey support.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-01 16:13:21 +03:00
Johan Hedberg e504aad28f Bluetooth: shell: Add pairing failed/complete callbacks
Add support for the recently added pairing failed/complete callbacks.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-01 16:13:21 +03:00
Johan Hedberg b049ac1216 Bluetooth: shell: Add command for setting fixed passkey
Add a shell command to utilize the newly added bt_passkey_set() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-01 16:13:21 +03:00
Luiz Augusto von Dentz 8780636ff8 Bluetooth: shell: Add hci-cmd command
hci-cmd can be used to inject an arbritrary HCI command which can be
useful when testing vendor/new commands.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-27 19:36:11 +03:00
Luiz Augusto von Dentz e9e5115116 Bluetooth: shell: Add name command
name command can be used to read or write the GAP Device Name which is
used by the advertise command.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Luiz Augusto von Dentz d1c4ce8741 Bluetooth: shell: Make use of BT_LE_ADV_OPT_USE_NAME
Use BT_LE_ADV_OPT_USE_NAME whenver possible since it does properly
track updates.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Ulf Magnusson 1073882998 subsys: kconfig: Remove 'default n' properties and clean up a bit
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Remove some 'default ""' properties on string symbols too.

Also make definitions more consistent by converting some

  config FOO
  	<type>
  	prompt "foo"

definitions to a shorter form:

  config FOO
  	<type> "foo"

This shorthand works for int/hex/string symbols too, not just for bool
symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-12 23:13:22 -04:00
Johan Hedberg d41d9bd112 Bluetooth: Convert sample code to use the new bt_data_parse() API
Convert the shell and central_hr sample apps to use the newly
introduced bt_data_parse() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-26 19:34:57 +03:00
Luiz Augusto von Dentz 1b038f2941 Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value
This ensures the every characteristic has a value attribute declared
with the same UUID since the old macro did not declare the value the
application would normally have to declare one itself using a different
UUID which is not allowed.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-05-14 18:51:22 +03:00
Johan Hedberg a29554360a Bluetooth: shell: Add settings support
Enable settings and increase the system workqueue size to deal with
the stack usage. This also makes it possible to test unpairing support
with the shell's 'clear' command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg d22b7c9f2d Bluetooth: Remove bt_storage API
The same functionality is now supported by the settings-based
solution, so remove bt_storage out of the way. There were stubs in
bt_storage to handle per-peer information (e.g. pairing keys) but this
was never actually implemented in full. The next step is to add this
support to the settings-based solution.

Leave the code for generating temporary IRK and identity address in
case BT_SETTINGS is not enabled. Also leave the code for using vendor
HCI to read the identity address, in which case the settings
implementation will not touch it.

Introduce a new bt_unpair() API to replace the removed
bt_storage_clear(), since the latter was actually doing more than just
storage management: it was also handling runtime storage of pairing
information. Later, the bt_unpair() implementation will be extended to
clear settings-based pairing storage.

There is one feature that the bt shell module looses: the ability to
give a specific identity address to the "init" command as a parameter.
We might look later in the future if this is really needed, and add a
separate API for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg ac133268a5 Bluetooth: Remove 'own_addr' from advertising parameters
This was originally added as a work-around to avoid the heavy stack
consumption of the TinyCrypt PRNG when generating NRPAs. This is
no-longer an issue, and there are in fact no (in-tree) users of this.
Remove it before it gains any wider users, since it was in many ways a
hack/work-around to begin with.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-21 18:11:49 +02:00
Carles Cufi 8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Carles Cufi f49150cab6 arch: arm: nrf: Rename nrf5 SoC Family to nrf
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01:00
Vinayak Kariappa Chettimada 4c123a5162 Bluetooth: controller: Refactor ticker integration into hal
Refactor ticker execution context dependency out into HAL
folder. This decouples ticker from mayfly, enabling porting
towards a more tasklet (if and when kernel gets the support)
style execution contexts type implementation support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-13 13:26:37 +01:00
Luiz Augusto von Dentz 800bfaf9a7 Bluetooth: UUID: Remove macros defining 16 bit values
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.

Fixes #5162

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 13:33:48 +02:00
Johan Hedberg 8fc4c99496 Bluetooth: Remove redundant AD parsing check
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>
2018-01-31 07:01:10 -08:00
Kumar Gala 26e4da52cf arm: nordic: flash: Use FLASH_DEV_NAME define
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>
2018-01-25 15:23:00 -06:00
Vinayak Kariappa Chettimada 5f4a7ea119 Bluetooth: shell: Support a non-connectable build
Add conditional compilation and move code to support
building a non-connectable Bluetooth shell application.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-01-25 10:51:54 +02:00
Vinayak Kariappa Chettimada e00282af6e Bluetooth: Fix build failure with -Wshadow CFLAGS
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>
2017-12-20 12:29:52 -05:00
Anas Nashif 429c2a4d9d kconfig: fix help syntax and add spaces
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-13 17:43:28 -06:00
Vinayak Kariappa Chettimada b022f72cf4 Bluetooth: shell: Fix compile error due to missing memq.h include
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>
2017-11-27 13:48:24 -08:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
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>
2017-11-08 20:00:22 -05:00
Vinayak Kariappa Chettimada 6831351799 Bluetooth: shell: Add controller DTM commands
Add controller Direct Test Mode commands to bt shell module.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-09-29 20:56:11 +02:00
Paul Sokolovsky 0592c0ce59 Bluetooth: shell: gatt_read: Reset offset to 0
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>
2017-08-15 21:16:40 +03:00
Carles Cufi d5c13a7530 Bluetooth: controller: Rename Kconfig prefix
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>
2017-08-14 15:44:56 +03:00
Johan Hedberg 2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
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>
2017-08-09 11:14:19 +03:00
Luiz Augusto von Dentz a864436559 Bluetooth: Shell: Add second vendor service
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>
2017-07-11 08:22:22 +03:00
Luiz Augusto von Dentz 17b340cc13 Bluetooth: Shell: Implement support for gatt-metrics off
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>
2017-07-11 08:22:22 +03:00
Vinayak Kariappa Chettimada ed85dea358 Bluetooth: shell: Fix compile warnings when CONFIG_DEBUG=y
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>
2017-06-29 07:43:54 +03:00
Johan Hedberg 4040610244 Bluetooth: shell: Fix incorrect #define
This should have been upper case and not lower case.

Fixes: ZEP-2322

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-28 09:52:26 -04:00
Andrzej Puzdrowski 9f964ba8d3 bluetooth: shell: add module for testing NRF5x flash driver
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>
2017-06-28 12:29:50 +02:00
Luiz Augusto von Dentz a6b37b072b Bluetooth: GATT: Rename bt_gatt_unregister_service
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>
2017-06-20 15:32:16 +03:00
Luiz Augusto von Dentz 272b3a5c99 Bluetooth: Shell: Add gatt-show-db command
gatt-show-db shows the current set of attributes available in the GATT
database:

bt> gatt-show-db
attr 0x0011ce80 handle 0x0001 uuid 2800 perm 0x01
attr 0x0011ce94 handle 0x0002 uuid 2803 perm 0x01
attr 0x0011cea8 handle 0x0003 uuid 2a00 perm 0x01
attr 0x0011cebc handle 0x0004 uuid 2803 perm 0x01
attr 0x0011ced0 handle 0x0005 uuid 2a01 perm 0x01
attr 0x0011cde0 handle 0x0006 uuid 2800 perm 0x01
attr 0x0011cdf4 handle 0x0007 uuid 2803 perm 0x01
attr 0x0011ce08 handle 0x0008 uuid 2a05 perm 0x00
attr 0x0011ce1c handle 0x0009 uuid 2902 perm 0x03
attr 0x0011c9a0 handle 0x000a uuid 2800 perm 0x01
attr 0x0011c9b4 handle 0x000b uuid 2803 perm 0x01

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz 01eeb5ea0b Bluetooth: Shell: Add gatt-unregister-service command
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>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz 79af35991b Bluetooth: GATT: Add bt_gatt_register_service
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>
2017-06-15 21:53:00 +03:00
Vinayak Kariappa Chettimada 8877348aec Bluetooth: shell: Fix compile error with LL cmds included
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>
2017-06-14 22:12:40 +02:00
Vinayak Kariappa Chettimada dc11c9c315 Bluetooth: shell: Add Extended Scan command
Add shell scanx command to start Extended Scanning on 1M or
Coded PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-14 18:40:40 +03:00
Vinayak Kariappa Chettimada 128a0613cd Bluetooth: shell: Add LE Adv. Ext. advx command
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>
2017-06-14 18:40:40 +03:00
Vinayak Kariappa Chettimada 0998cdfba1 Bluetooth: shell: gatt-write-without-response with repeat
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>
2017-06-04 09:34:08 +03:00
Vinayak Kariappa Chettimada a3cba8bb90 Bluetooth: shell: Add controller's ticker shell module
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>
2017-06-01 12:32:47 +03:00
Luiz Augusto von Dentz da86ae0cb6 Bluetooth: Shell: Rework gatt-write-signed
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>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz a5aa904f90 Bluetooth: Shell: Fix help of gatt-write-signed
gatt-write-signed does not have an offset parameter.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz 26eae70da2 Bluetooth: Shell: Remove gatt-write-without-response-repeated
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>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz 6107f61d8c Bluetooth: Shell: Fix help of gatt-write-without-response
gatt-write-without-response does not have an offset parameter.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz 6abccb6d40 Bluetooth: Shell: Split GATT command to its own file
This makes it simpler to organize the GATT command implementation.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz 54d917f767 Bluetooth: Shell: Add shell subdir if CONFIG_BLUETOOTH_SHELL=y
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>
2017-05-30 16:39:05 +03:00
Luiz Augusto von Dentz 7b9013140d Bluetooth: GATT: Fix not queuing writes to CCC
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>
2017-05-30 14:34:11 +03:00
Vinayak Kariappa Chettimada fe3aeebcfa Bluetooth: shell: Fix scan on to use active scanning
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>
2017-05-29 18:21:36 +03:00
Luiz Augusto von Dentz 737a9dc306 Shell: bt: Use SHELL_REGISTER_WITH_PROMPT
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>
2017-05-29 10:42:21 +03:00
Luiz Augusto von Dentz 12d1b2aa32 Shell: bt: Fix build without CONFIG_BLUETOOTH_GATT_CLIENT
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>
2017-05-29 10:42:21 +03:00
Luiz Augusto von Dentz a6f75bebc7 Shell: bt: Add command supported by btshell
This adds existing commands support by btshell test application to bt
module.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00
Luiz Augusto von Dentz 1c4561925c Shell: Add initial code for bt shell module
This adds the config option and files of the bt shell module.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00