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>
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>
Increase the resolution of advertising random delay from
1 ms unit to 1 us units. The controller scheduling will
floor it to nearest 32KHz clock unit on nRF5 series.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Auto connect code reuses bt_conn object and connection code was assuming
object was cleared which resulted in invalid code being provided to
application. Fix that by explicitly setting error code to 0 on
successful connection.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Depending on perhiperal advertising interval 3 seconds might not be
enough and would result in cancelling pending connection. Make this
Kconfig configurable and let application to decide.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Under GNU C, sizeof(void) = 1. This commit merely makes it explicit u8.
Pointer arithmetics over void types is:
* A GNU C extension
* Not supported by Clang
* Illegal across all ISO C standards
See also: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
Applications may require different scan windows and interval depending
on expected re-connection time or peer devices advertising parameters.
Default to GAP recommended slow values.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
In order to avoid the build system complications that come from
including a timestamp, remove it by default from the version string in
HCI Vendor Extensions. Users can still include a unique identifier, be
it timestamp or not, using the CONFIG_BT_CTLR_HCI_VS_BUILD_INFO Kconfig
option.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The Data Length Update implementation reused the flags used
by Encryption Procedure which caused invalid Encryption
Procedure sequence under conditions where Data Length Update
Procedure collide with Encryption Setup initiated by the
peer central device.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The address of the device is also set via HCI interface when passive
scanning is used. As a result, LL does not filter out directed
advertising packets that are targeted at this device.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This allows to configure desired parameters for peripheral. When set
PPCP characteristic is also added to GAP service. If disabled it is
up to application to controll connection parameters and stack will
only enforce 5 seconds delay before update.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This fixes a few issues with the handling of Connection Parameter
update in the Host:
- starting conn param update timer as master
- ignoring 5 seconds slave timer when calling bt_conn_le_param_update
- starting conn param update timer on every PHY update
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
There is an unnamed choice for the BT link layer selection.
Giving the choice a name would allow multiple declarations of the
option and the ability to select out-of-tree LL's.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
So far the stack hasn't provided any way for the application to access
the existing bonds. This patch adds such an API.
Fixes#10122
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This uses net_buf_append_bytes to reassemble the SDU segments instead of
doing it manually.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the remote stack is not able to fully utilize each segment it is
possible it would run out of credits before completing the SDU, these
changes detects if that would happen and attempt to restore enough
credits for the SDU to be received.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This simplify the logic of restoring the credits after each SDU instead
of using an arbitrary threshold which was not configurable per channel.
Because the credits are restored only when the full SDU has been
reassembled it means the channels needs to be set up with enough for
the configured MTU otherwise there is a risk of the channel to run out
of RX credits before the packet is fully reassembled, because of such
corner case the code will now warn if a channel is setup with not enough
init_credits.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
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>
When activating SystemView internal kernel header files will be
included. This causes a name conflict with smp_init in smp.c
and smp_init in kernel_internal.h
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This fix ensures that the handle range used for next GATT discovery is
always inclusive. Previously, the discovery procedure could not be
started with equal value of start and end handle.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This allows to provide public address for controller without using
VS HCI command from host. Useful for controller only builds or
combined builds that are not using VS HCI commands.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
The current method relies heavily on the linker/compiler to
do the correct operation. Which is to eliminate the code that will
never get called. This posses a problem if the build even changes
by a smallest fraction.
The current patch will enforce proper inclusion of the code at the
pre-processing stage. Thereby not relying on the compiler/linker to
do the right thing.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
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>
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>
Add functionality for setting the host channel classification in
the controller using the HCI command.
This closes issue #9851
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
When running combined build on nRF5 with disabled VS command it is
possible to simply read static random address from FICR in host.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
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>
This adds a function that will disable Bonding flag in
Authentication Requirements flag in SMP Pairing Request/Response.
This is needed for qualification purposes.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This will exclude testing Mesh related code from build if BT_MESH
option in Kconfig is not set.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
This makes bt_gatt_discover perform discover all proceduce if no UUID
is given in the parameters.
Fixes#9713
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Long write procedure currently requires BT_GATT_PERM_PREPARE_WRITE to
be set otherwise the prepares would fail. This changes the behavior so
that BT_GATT_PERM_PREPARE_WRITE enables checking each prepare chunk
skipping it otherwise.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
None of the data for the CEP, CUD and CPF descriptors needs to be
modified by the stack at runtime. Make it possible to pass constant
data to the descriptor macros, and make sure the descriptor handlers
cast the data back to be a constant.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The req variable in smp_pairing_failed() does get used, so
ARG_UNUSED() is inappropriate for it.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Just like we set the address for an identity without depending on the
BT_DEV_READY flag, we should do the same for the IRK. Otherwise we
risk getting an all-zeroes IRK. Remove the condition and always set
the IRK value whenever CONFIG_BT_PRIVACY is enabled.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code creating identities from the Read_Static_Addresses vendor
command was failing to create matching IRKs, resulting in an
all-zeroes IRK to be used. Fix this by using the existing id_create()
function which takes care of generaing an IRK when necessary.
Fixes#10003
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
A subsequent patch will make bt_setup_id_addr() depend on id_create()
which was so far lower down in the hci_core.c c-file. Move
bt_setup_id_addr() further down to avoid a forward declaration.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are some cases where atomic_and/or don't need to be
checked. Actively acknowledge these cases.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
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>