We cannot implement configure API because there is
no notification of configuration changes provided
for the Abstract Control Model and the UART controller
is only emulated.
However, it allows us to use CDC ACM UART together with
subsystems like Modbus which require configure API for
real controllers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Move the CAN bus network driver from drivers/can to drivers/net as it
implements a network driver, not a CAN controller driver.
Use a separate Kconfig for enabling the CAN bus network driver instead of
piggybacking on the SocketCAN Kconfig. This allows for other
(e.g. out-of-tree) SocketCAN transports.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Struct bt_mesh_send_cb.end is called from the mesh advertiser thread.
bt_mesh_reset now requires more stack size, thus can't be called from
the advertiser thread. k_work instance requires less memory than needed
for bt_mesh_reset.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Upon bt_mesh_reset call, all mesh modules has to clear the privisioning
and configuration data. None of the modules store or erase in settings
subsystem immediately, but put this on the mesh settings work. After the
settings work is scheduled, all stored data will be removed and the
device will eventually be unprovisioned. Until then, the device is not
completely unprovisioned, thus calling bt_mesh_prov_enable,
bt_mesh_provision (and bt_mesh_cdb_create) should not be allowed.
Struct bt_mesh_prov has a reset callback stating that after this
callback is called, the device has been reset and can be re-provisioned
again. Also, bt_mesh_reset API description states that after calling
bt_mesh_reset API, the device needs to reenable the provisioning layer
to be provisioned again. But this is not correct since the settings has
to be cleared before the device can be reprovisionined.
This commit makes bt_mesh_reset flush pending settings so that the
device can be reprovisioned immediately and the API will behave as
written in the description.
The same applies to bt_mesh_cdb_clear.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.
The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.
This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.
This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.
The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use `kernel log-level modulename severity`
Also enable it for the Bluetooth Shell.
Then one can compile-in a lot of BT modules like so:
CONFIG_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_L2CAP=y
CONFIG_BT_DEBUG_ATT=y
CONFIG_BT_DEBUG_GATT=y
And at runtime select only, e.g. GATT
kernel log-level bt_hci_core 0
kernel log-level bt_l2cap 0
kernel log-level bt_att 0
And then re-enable L2CAP if needed later
kernel log-level bt_l2cap 4
And so on..
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add commands to connect to an l2cap channel using Enhanced Credit-based
Flow Control, and to reconfigure it.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
When invoked without parameters, `bt connect` will now attempt to connect
to the last scanned device. Used in conjunction with the RSSI filter, this
makes the connection process somewhat scriptable.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This adds an RSSI cutoff, so any scanned devices that are below the given
value (in dB) will not get printed out. Very useful in noisy environments.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add two MEDIA_PROXY group type defines corresponding to the MCS ones.
Update the mpl.c to use the newly added names.
The purpose of the exercise is to get a complete set of MEDIA_PROXY
defines, so that the media player can be made fully independent
(define-wise) of the MCS.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Update the media player to use the MEDIA_PROXY_* defines rather than the
BT_MCS defines. The media player should not know about the MCS (media
control service).
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
The bus_label field of the struct was not used, so remove it. This
lets us remove one of the last users of DT_INST_BUS_LABEL.
Signed-off-by: Kumar Gala <galak@kernel.org>
Check that the device we are trying to use has successfully powered up
when it is on a power domain. If it has not, release the request for the
power domain to be powered to ensure we do not have dangling requests.
As a result of this, `PM_DEVICE_ACTION_RESUME` will not be run on a
device if `PM_DEVICE_ACTION_TURN_ON` has already failed.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Store errors powering up devices in a flag in the PM struct. This is
required as the `pm->state` variable always transitions to
`PM_DEVICE_STATE_SUSPENDED`, even when `PM_DEVICE_ACTION_TURN_ON`
returns an error. Marking the transition as failed will allow the
transition logic in `pm_device_runtime_get` to detect the problem.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>