Fix a bug introduced by 658123bb21 where if all backends were
ready prior to logging thread loop, thread was periodically
waken up for no reason. Fix is setting timeout to K_FOREVER
if all backends are ready after the initialization.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added check which ensures that only backends with autostart
flag set are enabled automatically by the logging.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add a new coredump query and command type to retrieve the raw data
stored to the flash backend
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
If the characteristic is non-writtable, the BT_GATT_CHRC_WRITE property
flag shall be unset. Moreover, threre is no point to set
BT_GATT_PERM_WRITE_ENCRYPT permission flag as well if the attribute has
no `write` callback set anyway.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add a new API used by arch to implement suspend-to-RAM (S2RAM).
The API is composed by a single function to save the CPU context on
suspend.
A CPU context is the arch-specific set of registers that must be
preserved on power-off (in retained RAM) to be able to resume the
execution from the point it was suspended without going through the
whole kernel startup stage.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
When switching from Extended Scanning by Extended
Advertising HCI commands back to Legacy Scanning after a
HCI reset it is required that the coded PHY scanning
context is reset.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Extended Scanning Address Resolution that incorrectly
checked for Bit Count Comparison which is not to be checked
when explicit resolution is performed in the Rx ISR.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use the maximum advertising PDU size time reservation
consider the Advertising Data could be updated from zero to
maximum support size. If maximum time reservation is
disabled then time reservation corresponding to the
Advertising Data present at the time of the start/enable
of Advertising is used.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When multiple advertising sets are support then use advanced
scheduling implementation to place multiple auxiliary PDUs
and periodic advertising PDUs in a non-overlapping schedule.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update the internal power state tracking for `PM_DEVICE_ACTION_TURN_ON`
and `PM_DEVICE_ACTION_TURN_OFF` even when the transition function fails.
Just because the driver couldn't perform some action does not mean the
device is still powered/unpowered.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add state checking to every transition to ensure that the device is in
the state we think it is before running the action.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
In case LWM2M cient wants to change attrs of observed obj,
it needs pointer to client_ctx.
For example:
On observer add, wants to change pmin for some obj path to 1s:
static void observe_cb(enum lwm2m_observe_event event,
struct lwm2m_obj_path *path, void *user_data)
{
struct lwm2m_ctx *ctx = (struct lwm2m_ctx *) user_data;
switch (event) {
case LWM2M_OBSERVE_EVENT_OBSERVER_ADDED:
lwm2m_engine_update_observer_min_period(ctx, "3347", 1);
...
}
Signed-off-by: Kiril Petrov <retfie@gmail.com>
Fix missing recv fifo reset on HCI reset. This fix handles a
scenario where in Rx Prio thread has enqueued a node rx, Tx
thread handles HCI Reset Command, and Rx thread wakes up
from call to k_fifo_get to handle invalid node rx. The
changes here ensure Rx thread does not get any invalid node
rx post HCI Reset Command handled in Tx thread.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added a new callback to the Bluetooth Extended Advertising callback
structure. It notifies the application that the RPA validity of the
advertising set has timed out. The user can use this callback to
synchronize the advertising payload update with the RPA rotation.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Synced the start of the advertising sets after each RPA rotation
in the Bluetooth identity module.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This adds the bits to allow the process thread to notify
backends when it has finished processing pending log messages.
This allows, for example, flash-based backends to group writing
log messages to storage to limit wear, since log_output_flush()
is called per message. Also the backend does not have to resort
to using timer to periodically flush its buffer to storage,
avoiding waking up the device when there are no messages.
Another use of this is for backends requiring DMA transfers.
Grouping all pending log messages into one DMA transfer is
sometimes preferrable.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Give Kconfig choices symbols names so that they can be redefined in
applications that wants to alter the choice's default value without
setting it in the project configuration.
Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
Move OpenThread's glue code along with the Kconfig files that configure
OpenThread stack itself into module directory.
Update the maintainers file to reflect this change.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
We noticed that in the master branch, updatehub fails to start.
That is because of the behaviour change in bin2hex caused by
commit f2affbd ("os: lib: bin2hex: fix memory overwrite").
Fixes: f2affbd973 ("os: lib: bin2hex: fix memory overwrite")
Signed-off-by: Yudong Zhang <mtwget@gmail.com>
Instead of rejecting metadata at the BAP layer, we now
expect the higher layer to provide the verification.
The reason for this is that the higher layer may be better
equiped at determining which metadata it supports.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CAP acceptor can now be a set member. This allows
the CAP acceptor to register a CSIS instance and include
it in the CAS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add bt_cap_acceptor_ccid_exist that verifies that CCIDs
from the CAP initiator are valid on the initiator based
on what we have previously discovered.
Verification from MCS is still a TODO.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the CAP acceptor role is enable, ASCS will verify
that the stream context type supplied by the client
matches the PACS available context.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Verify the metadata before copying it. This will allow the
unicast server to verify the data and potentially
reject it without modifying existing metadata.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adding the CAP Acceptor role, which is a quite simple
role. The role instantiates the Common Audio Service (CAS)
The role will later be expanded to properly support
the use the Coordinated Set Member role via CSIS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the CONFIG_BT_AUDIO_DEBUG_STREAM_DATA Kconfig option
to better debug bt_audio_stream without drowning the log
in the data being sent.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the BT_DEBUG_ISO_DATA so that ISO can easier be debugged
without the logs being drowned in the ISO data being sent
and received (which is typically at a low interval like 10ms).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Uses the dt_compat_enabled Kconfig preprocessor to set defaults
for each HDA driver.
Each direction is uniquely selectable which can be useful when building
with SOF where only some directions may wish to be enabled at any given
time.
By default, given the device tree (intel_cavs.dtsi) only the host
directions are enabled but an overlay may adjust that as needed.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Use the same function at discovery complete, whether discovery failed
or succeeded.
Rename the discovery_failure() to discovery_complete(), and use that
also when discovery completes successfully.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
The media control client used to subscribe to GMCS characteristics as
the characteristics were discovered, in effect queuing ATT requests.
Since then, the ATT MTU exchange has become automatic, leading to
larger ATT MTUs and more discovered characteristics per ATT response,
which again lead to the client enqueuing more subscriptions and
running out of buffers, with discovery failing as a result.
This commit moves the subscription to GMCS characteristics to a
separate sequence, so that it happens serially after discovery, rather
than in parallel with the discovery.
- Remove separate discovery parameters for the characteristics - they
are no longer needed.
- Add a subscription callback and a couple of subscription functions
The subscription for characteristics for the included OTS has not been
modified. Only two of these are subscribed to, and doing that is
currently not a problem. And I need to better understand the
interaction with OTS and how these subscriptipons are used.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Refactor subscription to get chaining into callback
Move the start of discovery of included services to a separate
function, in preparation for rewriting discovery.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
When bool is typedef'ed to for instance char the cast from 64 bits
is not so good. Now using an explicit 'cast' to true/false
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Implements PDU flow and unittest of CIS Create on Peripheral
Hooks CIS Create into the controller and fixes a few minor
things in ull to allow for running with NEW LLCP
Also handles CONFIG based comilation of CIS Create
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Hooks the CIS terminate into the controller and fixes a few minor
things in ull_conn(_iso).c
Also handles CONFIG based comilation of CIS_TERMINATE
also fixes a minor issue in helpers_pdu
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Add macro Z_TEST_SKIP_IFNDEF which is used when you want to skip test
if configuration option is not enabled.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>