At present this driver only supports SPI. Refactor it so that SPI is
just one of the options. This does not change any functionality.
Signed-off-by: Simon Glass <sjg@chromium.org>
This emulator currently only supports SPI. Before making it also
support I2C, move it up a directory to avoid I2C uses missing it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move the logging for transactions to the functions that actually access
registers and sample data. This avoids needed to repeat this code when
I2C starts calling these functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update the language to refer to a bus instead of SPI. This will make it
more applicable with I2C support is added.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some LWM2M backends/servers, such as emxq, expect the sequence numbers
to begin on 0.
This change is in line with how other lwm2m clients, such as Anjay and
Wakama, starts the notification sequence.
Signed-off-by: Viktor Sjölind <viktor.sjolind@endian.se>
Fix arguments unused when not enabling Extended Scanning
which was introduced in
commit 0cef1e43c9 ("Bluetooth: controller: Extended
Scanning Coded PHY duration and period").
Fixes#29442.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The commit 93e5181f ("net: context: Add locking for concurrent
access") added net_context locking to only IPv4 sockets.
That is not enough and we need locking also to other supported
socket address families like IPv6, SocketCAN and packet socket.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix application conn param update submitted before the timeout of
CONFIG_BT_CONN_PARAM_UPDATE has expired being ignored when
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Rename the update_work handler to deferred_work since this handler
is being multiplexed for different kinds of deferred work, not just
updating the connection parameters.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Move auto-initiation of the peripheral connection parameter update,
this handling would only submit the delayed work with the timeout once
all other auto initiated procedures had completed. This behavior means
that the delay would not be set on when the connection was established
but instead relative to the previous procedures.
Based on the connection interval used, the instant(s) used, and the
number of auto procedures this delay becomes indeterminate.
Submit the work once connected, the constraint that existed in the
zephyr link layer earlier about requesting only one control procedure
at a time has been removed.
This also brings all the handling of the timeout work to the connection
state handling, which makes it easier to track this behavior in code.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Document the behavior of the bt_conn_le_conn_update API when the
local device is the peripheral role.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Prior to this commit, the LwM2M stack would TLV-encode integers
depending on their internal storage size. An integer with value 5 stored
in an int8_t would be encoded with length 1, but an integer stored in an
int32_t would be encoded as "00 00 00 05" with length 4.
This commit checks if the value is castable to a smaller int and encodes
it as such if so. This is cascading, so even a 64 bit integer with value
5 will be encoded with length 1.
Note that this does not seem to be required by the specification, but
this is how Anjay and the other LwM2M stack seem to do it.
Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
Add Queue Size and Receive Window information to lpn
callback function to notify upper layer to determine
currently friend node information, which may be used
in future.
Add Callback structure to notification application which friendship
has been changed.
Add function `bt_mesh_friend_terminate` let's app layer determine
terminate friendship manually.
Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
Fix ifdef in command inclusion, in practice this meant that
CONFIG_BT_LL_SW_SPLIT and CONFIG_BT_CTLR_ADV_EXT switched meaning.
Added blank lines so that the commands in shell/ll.c are more
easily visible as group.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The struct fs_file_system_t is only useful when defining file system
drivers and is not required for typical application development,
that is why it has been moved to separate file fs_sys.h.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
When we are sending ICMPv6 error message, we need to store the
link local addresses of the received packet somewhere in order
to know where to send the new error message.
Easiest is to store the ll addresses is to the error message
itself, just before where the sent packet will start in memory.
We cannot use the original pkt to store the ll addresses
as that packet might get overwritten if we receive lot of packets.
Fixes#29398
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Introduce a support kconfig for controller ECDH command support.
Default to host ECDH emulation in combined host controller build
where the controller does not support these commands.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This is a major refactoring of the handling of the cryptographic
material of both the network and transport layers. The aim is to
encapsulate the key object manipulation, and improve overall modularity.
Pulls Applications and Subnets out of the bt_mesh and into separate
modules, with static storage types on the data. This has several
side-effects:
- The Config Server no longer operates directly on the bt_mesh.subs and
bt_mesh.apps lists, but goes through a public configuration interface,
following the pattern set in #27908.
- All iteration through the keys is done through iteration APIs
- Key resolution on RX and TX is centralized.
- Changes to the keys triggers events the other modules can register
handlers for.
- Friendship credentials are stored in the lpn and friend structures.
Part of #27842.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This makes it possible to pass different byte arrays to gatt write
making it usable to test attributes that take more than a single byte.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This prevents any work to be submitted until the stack is initialized
thus avoiding pointless hash generation, etc, while initializing the
system.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Adds support for enabling/disabling PA sync receive,
which allows applications to control when to receive data
while a sync is established.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If an ACL connection is disconnected while there is an ISO connection
associated with it the ACL connection will not be cleanup properly as
the code attempt to cleanup the ISO connection and breaks without
proceeding to cleanup the ACL as well.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The callbacks has been moved from being local to each
bt_le_per_adv_sync object, to being global. The
removal of the pointer in bt_le_per_adv_sync was
missing from that update.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix shell build errors when building with combined host and controller
but the selected controller is not the in-tree zephyr controller, i.e
CONFIG_BT_CTLR=y, CONFIG_BT_LL_SW_SPLIT=n and cmd_scanx and others
are not defined.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Currently, there is a case for net_config_init function that for
timeout==0 and when iface is already up, the ip setup is not proceed
and the error message "Timeout while waiting network..." is logged.
This commit fixes it.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
Adds the socket option TLS_ALPN_LIST for SOL_TLS sockets
Passes the configured alpn list to the mbedtls config
on mbedtls init
Signed-off-by: Emil Hammarstrom <emil.hammarstrom@assaabloy.com>
If we are sending data directly, we already have TCP lock so
there is no need to do any locking. But when data is re-sent,
the work queue handler is doing the sending so we need to lock
the TCP connection.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When receiving data that needs to be passed the data to application,
queue it for short time so that we do not have TCP connection lock
held. This way if the application wants to send data, there is no
possibility that the connection lock would prevent sending data.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Release the context lock before passing data to the application
socket as that might cause deadlock if the application is run
before the RX thread and it starts to send data and if the RX
thread is never able to run (because of priorities etc).
Fixes#29347
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When waiting for data from CP, the data timeout check must happen before
no-data check. If not, a partial packet may endlessly hold PD in
"wait-for-data" state, while the PD keeps reporting status as online
till another packet is received.
Fix this my moving no-data check below the timeout check.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
All OSDP packets must start with a mark byte (0xFF) followed by a Start
of Message byte (0x53). Skip all bytes received until such a sequence is
seen to to avoid waking up the refresh thread needlessly.
Also, refactor osdp_uart_isr() to reduce number of local variables.
Fixes: #28168 Coverity-ID: 214218
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Minimize number of exported methods by unifying all osdp_cp_send_cmd_*()
as osdp_cp_send_command().
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Exported header oftenly used when creating a logging
backend that inpects the log 'stream'.
Enables use in external Zephyr modules implementing the
logging backend interface.
Signed-off-by: Emil Hammarstrom <emil.hammarstrom@assaabloy.com>
These defines are leftover of old platform settings implementation
and are not used any more.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
Use conversion macros to convert Extended Scan duration and
period to radio event counts.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to support simultaneous 1M and Coded
PHY Extended Scanning duration and period. Also, added
implementation to support update to duration and period of
an active scanning instance.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the ll_scan_enable interface signature, place duration
before period parameter to reflect the order as in the HCI
LE Set Extended Scan Enable command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix scan done to be generated when the window is closed
both under abort and graceful window close.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>