This commit updates models metadata API to simplify the usage and
removes the metadata pointer in health server model context.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Add an extra "usage=%d" to the device status to show the current usage
counter when PM runtime is enabled.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a shell_device_filter variant of the shell device lookup helper that
takes a callback as an argument. This allows more complex filtering on
the device than the existing name prefix.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
When in the BAP unicast server role, at least PAC sink
or PAC source shall be set.
In order to fulfill this new requirement, a few other Kconfig
options had to be changed to a `depends on` from `select` to
avoid recursive Kconfig requirements. This change may require
some applications to update their configurations according
to the migration guide.
The change from `select` to `depends on` is ideal anyhow
as that is the recommended way to add dependencies.
This can checked via the combined BT_PACS Kconfig value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Original code developed as a GSoC 2023 project by Emna Rekik.
Code refactored in order to provide better bisectability
as the origical commits were not bisectable.
The server supports static and dynamic resources, managed by
HTTP_SERVICE/HTTP_RESOURCE macros.
Fixes#59685Fixes#59686Fixes#59688Fixes#59690Fixes#59670Fixes#59700Fixes#59684Fixes#59693Fixes#59693Fixes#59694Fixes#59699Fixes#59696Fixes#59688Fixes#59690Fixes#59670Fixes#59700Fixes#59685Fixes#59686Fixes#59688Fixes#59691
Signed-off-by: Emna Rekik <emna.rekik007@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add HTTP/2 helper libraries to encode and decode HPACK encoded headers,
according to RFC7541.
HPACK string encoding requires to support certain set of Huffman codes,
therefore implement Huffman encoder/decoder as well.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When building ISO applications on a device that has the host
and controller on the same core, the application developer
shouldn't have to set controller specific configurations.
Without this change the samples iso_receive and iso_broadcast
will fail to run on NRF52 series devices as the samples
try to set up two streams but the controller is configured
to support only one.
Controller unit tests that were previously only enabling the
controller specific ISO configurations now also enable the
top-level ISO configurations to ensure that the default
stream count is properly configured.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
In case of successful submission, the reference shouldn't be put down,
this only should done on error cases.
As reference is put down on success, during the buffer unref, no action
is taken due to an uint8 overflow (ref is now 255), so, the buf->frags
isn't cleared properly and the next time the frags is used and when L2
inserts a second frag, the first head frag and next frag are same (due
to buffer re-use) causing an infinite loop in either net_buf_frag_last
or net_pkt_get_len.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
We can't enable device runtime power management in a device that is
set busy since it may suspend this device.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Unicast RX stats
It represents total number of unicast (any type data, action or
any other unicast frames) frames received at firmware level.
The actual frames passed to host will be different as firmware
may drop packets or some packets may be dropped because of
errors.
Unicast TX stats
Transmission side the unicast packets count states the packets
handed over to firmware. The stats taken at firmware level.
Actual packets transmission may vary depending upon various factors.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
Add USB out support for the BAP shell, so that decoded LC3
data can be sent to the host (e.g. a PC).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The volume controller always set the busy flag in
bt_vcp_vol_ctlr_set_vol, where it should only set it
if the GATT operation succeeds.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Send a `READ_MAX_ADV_DATA_LEN` command to the controller at the
initialization of the host to fetch the maximum advertising data length
the host can accept.
This is done because even if the Zephyr controller provide the
`CONFIG_BT_CTLR_ADV_DATA_LEN_MAX` Kconfig symbol, other controllers may
not have such Kconfig symbol. So this is a way for the host to be more
controller-agnostic and provide useful feedback to the users.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.
Fixes#71907
Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
Commit adds using host\controller based random number
generator instead of zephyr driver.
No mesh dependency anymore on zephyr system
random driver.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This function is used in many places, but just by reading its
name it is not obvious why it is needed.
By adding some documentation it will hopefully become a bit more
clear that this function is mainly used for auto connection
establishment.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This line was clearly intended to check for the value returned by
ad_init(). The ad_len is unsigned, so checking for a negative value
showed up in a recent Coverity run (no GitHub issue for it yet).
Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
Update the documentation of `BT_CTLR_ADV_DATA_CHAIN` Kconfig symbol to
say that it's only supported in *non-connectable* extended advertising.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
We can (and do) open multiple channels with a single L2CAP command. If the
remote doesn't support dynamic channels at all, then it sends back a
REJECT_RSP.
We only destroyed the first channel that matched the command PDU
identifier. Fix that and remove all channels that match.
Also add a test that verifies the patch.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Instead of having the boards override the default
in their Kconfig.defconfig
let's just default to IMMEDIATE logging mode in the main
definition if we are building for a ARCH POSIX board.
This avoid issues w dependencies being lost if not duplicated
correctly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Commit fixes bug if dfu server failed to deliver
apply response it gets stuck in applying phase.
In this phase it skips all further client attempts
to apply image again.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Backend index must also be incremented, when backend is not an autostart
backend. Otherwise, the resulting bit field can not be used to address
a backend by index; autostart field would have to be taken into account.
Signed-off-by: Torsten Robitzki <Torsten@Robitzki.de>
Ignore failure to Broadcast ISO remove data path when
terminating a BIG without a data path being setup.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When multiple advertisers overlap over time, the random
delay being applied need many ticker operation context.
This causes the ticker_update interface to return error
causing assertion in the Controller.
This is fixed by not applying random_delay value to the
overlapping advertiser that does not get to use the radio.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add support for a "pm" shell command to trigger suspend/resume as well
as runtime-get/put on devices. This is useful for testing during driver
development.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
In the follow expression:
cyc_evt += UINT32_MAX + 1U
first it is evaluated (UINT32_MAX + 1U), since both types
interpreted as uint32_t, this operation causes an overflow resulting
in 0U.Then we have
cyc_evt = (uint64_t)cyc_evt + 0U
Fix it casting of the operands in the first operation to uint64_t.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Refactor only. The surrounding ifdefs are intentionally not changed in
this patch. They will be in the near future.
Rename the pool and generalize the documentation to allow using this
pool for other events that fit the same criteria. This pool can be used
for any buffer that is processed synchronously, without negatively
affecting 'num complete' messages. E.g. 'cmd complete/status' can be put
in this pool already.
We will be working towards making the host process all event buffers
synchronously. This is because events have no dedicated flow control,
and discarding events in the driver without informing the host creates
problems. Discarding should instead happen in the host higher layers
when unavoidable.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
There was a typo in Kconfig check (missing CONFIG_ prefix) which
resulted in not setting OACP_FEAT_BIT_CRC bit in features.
This also resulted in checksum feature being disabled due to check
in bt_ots_init().
This was affecting OTS/SR/OASP/BV-03-C qualificatio test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
We were missing a helper function that can be used to check
whether the given function is the virtual VLAN interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As per the BAP spec, the scan delegator device should add the BASS service
data in the extended advertising data when it requests a broadcast
assistant to scan for it. For testing purposes that's usually the case
with the shell, extended advertising data shall be populated with the
BASS service data.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
I am using the tracing module using the RAM backend on a system with
limited RAM & a buffer that can only store 300ms of tracing data. Current
tracing module starts recording during boot-up & we run out of memory prior
to executing code we actually want to trace.
By reseting buffer metadata here, I can call init() at an arbitrary point
of program execution & the tracing module will reset & start tracing.
I tested on E2E on an ARM M-class MCU by calling init & then reading
buffered tracing data via GDB
Signed-off-by: Galen Krulce <gkrulce@meta.com>
Similar to logging module, allow application specific extension of
shell fprintf APIs at a macro level.
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
Improve the default serial backend init level.
The documentation says to be bigger than the init level of the serial
device used. Since serial devices default to the kernel device init
level (50) then put this to default of application level drivers (90).
Signed-off-by: Joakim Andersson <joerchan@gmail.com>
Add aux offset population assertion check, to ensure the
aux offset calculation is completed before the primary
PDU is setup for transmission.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Commit fixes behavior when provisioning protocol accepts
incoming transaction before ongoing tx transaction is
still active (device didn't receive acknowledgement yet).
Incoming data are ignored until ack is not received.
Specification:
5.3.3 Generic Provisioning behavior
...
If the sender receives a Transaction Acknowledgement
message, then the transaction has completed.
If the sender receives a message with other PDU types,
then the message shall be ignored.
...
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Those helpers allow to define some typical kinds of chat matches and
scripts with more ease/less boilerplate.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>