The `%.*s` format specifier expects an int so cast the size_t parameter
to int.
Fixes an issue spotted in CI for:
west twister -p native_sim/native/64 -s sample.net.dns_resolve.mdns
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add bt_cap_unicast_group_get_info to get information about
a CAP unicast group. For now this just contain the pointer
to the BAP unicast group, which then can be used with
bt_bap_unicast_group_get_info to get information specific
to BAP. The bt_cap_unicast_group_info struct can later be
expanded with any additional information CAP may add.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add bt_bap_unicast_group_get_info to get information
about a unicast group. In this first iteration the info
struct only contains the sink and source presentation
delay, but the info struct can easily be expanded on
later to contain more.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
BAP section 7.1 states that all streams in a direction shall
have the same presentation delay. To achieve this, we need to
store the configured presentation delay for a unicast group,
so that we can compare with the new presentation delay.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the SHI driver receives data from the host and finds it is invalid
(due to a checksum error or an unsupported protocol version),
it currently resets the state machine, initializes the output buffer,
and waits for CS de-assertion. Upon CS de-assertion, the driver resets
the state machine and initializes the output buffer again. This commit
removes the first redundant reset and re-initialization in the function
`shi_npcx_bad_received_data()`, improving the driver’s efficiency.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Renamed the static function `rtu_tx_adu` to `modbus_rtu_tx_adu`
for naming consistency with `modbus_rtu_rx_adu`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
add a wrapper function to read the number of bytes currently buffered
and pending for the next flash write operation.
Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
These types are useful for IoT deployments and should be available
thru the resolver interface to get the data. The SRV is especially
useful to find services on the local network when not using a dns-sd
deployment and just something like Avanhi or Bonjour.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
When resolving SRV records - the label might not be compressed so
the first entry into the net buf is the start of the name and a
period could end up at the start - ie. ".example.local" so only add
a period when the buffer is not empty.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
The enum will auto increment, so in debug the IP and DATA records are
negative numbers which initially made this look like an error, so just
push the expected good values to be positive numbers in case of a print
or something else would imply these are ok.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
There was an issue where terminating the BIG while in the
ISO connected callbacks could lead to continueing the loops
would cause access to cleared memory.
The simple solution to this is to simply prevent
bt_iso_big_terminate from terminating the BIGs while we are
processing the BIG HCI events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The broadcast code was attempting to read from argv[1] instead
of argv[2] that actually contains the broadcast code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add checks on the fs pointer passed through the api before using to
avoid causing an exception
Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
zms_active_sector_free_space is documented to return -EACCES on fs not
mounted error but currently returns an usigned type size_t. This fixes
that by changing the return value into a ssize_t
Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
Implement the function bt_cap_initiator_broadcast_foreach_stream that
allows users to iterate on all BAP streams in a BAP broadcast source.
This can be used to easily get references to other broadcast streams in
the same group.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Check that SegN is not 0. SegN = 0 is invalid as the first segment is
sent in Transaction Start PDU.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Instead of add BT_UUID_BROADCAST_AUDIO_VAL for either BAP or
CAP, we now only do it one place (in BAP). This can now be done
since the default_source.broadcast_id was recently added.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a broadcast_id field in broadcast_source so that it can be
lookup later, which is useful for doing broadcast assitant
procedures on a local broadcast source.
The broadcast ID is now created at the same time as the
broadcast source(s), instead at the time of retriving
the advertising data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Check that the buffer length of the received advertising data is less
than reported TotalLength in Transaction Start PDU.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Fix building with Privacy feature without enabling LE
Encryption support. This should allow being either Observer
or Broadcaster role with Privacy features.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a bullet point for this new, relatively important deviation from
the official specification.
Also, advertise the Zephyr-specific zephyr/psa/* header files as they
are related and probably need more attention from end users.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Instead of literally having 0x in the format string, use the %# flag
character so the printf implementation adds the 0x for us.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Cast the UIDs to unsigned long when they are 32 bits.
This allows to use a single %l length modifier instead of the double
one for long long.
Certain printf implementations only support the former and not the
latter length modifier, so this has the advantage to work with them
now that the UIDs are 32-bit by default.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Make the storage UID type 32-bit long.
This makes it more convenient to use those UIDs as storage entry IDs
when storing the entries to NVM.
The previous 64+ bits UIDs made it incovenient to use them as such.
As Zephyr defines UID ranges to be used (see
e.g. `zephyr/psa/key_ids.h`), this guarantees that all the UIDs will
fit within the 30 bits reserved for them.
The secure storage ITS implementation API is changed to take
`psa_storage_uid_t` separately so the implementation can check
that no forbidden bits are set before they are packed into
`secure_storage_its_uid_t`.
This change breaks backward compatibility because
`secure_storage_its_uid_t`, which is used both as part of the additional
data for authentication and for generating encryption keys, changes
size from 12 to 4 bytes.
For users wanting to preserve backward compatibility (for example when
upgrading an existing installation to a newer Zephyr release) or that
for some reason want to use a 64-bit `psa_storage_uid_t`, the Kconfig
option CONFIG_SECURE_STORAGE_64_BIT_UID is added. When enabled, it
makes the implementation behave the same as previously and compatibility
with existing entries is preserved. This was tested manually.
Fixeszephyrproject-rtos/zephyr#86177.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Remove the EXPERIMENTAL label from the MODEM_MODULES and update
API version to 1.0.0. These modules are fully tested and widely
used, and have been present for 2 years.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Update Kconfig dependencies in mbedTLS and logging backend to use
OPENTHREAD instead of NET_L2_OPENTHREAD.
Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
Fix prepare pipeline processing of overlapping events by
including ticks_at_expire value to uniquely identify
overlapping events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix long standing bug in processing resume events that cause
prepare pipeline overflow due to incorrectly enqueueing up
preemptor events as duplicate events in the pipeline where
being aborted before currently active event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Introduce prepare being deferred due to previous events
desire to continue. In such case the deferred prepare param
will have the defer flag set.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Disable connection event continuation on overlap with same
connection's next event. This implementation has bugs and
needs to be fixed in subsequent commits.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix stuck forced continuation of connection event under high
throughput scenario. At near supervision timeout the force
flag is set, but in the next connection event if full
connection interval is used for data transmission and a
subsequent request to abort happens it was not honoured
causing the tx-rx chain to keep continuing until supervision
timeout.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix window widening on connection update to current window
widening periodic at the instant, and use new periodic
window widening for subsequent new connection interval.
Relates to commit 247037bd3e ("Bluetooth: Controller: Fix
incorrect elapsed events value").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix drift compensation applied late under high throughput at
after the instant has passed for a connection update.
Workaround test failures due to Zephyr Controller scheduling
overlap causing Periodic Advertising Sync timeouts, ACL
connection failed to be established or Controller assertion
when having latency at the CIS setup instant.
Workaround by using `-start_offset` to ensure that the ACL
established does not overlap the sink being established.
Relates to commit 5f852998d0 ("tests: bsim: Bluetooth:
Workaround Zephyr Controller scheduling overlap").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Unlike legacy Zephyr Controller's double headed Tx queue
linked list, the new split Zephyr Controller's new LLCP does
not place a control PDU at the head of the Tx queue causing
control PDUs to be delayed on air.
Pause the data enqueue until pending PDUs are transmitted
across before enqueuing LE Connection Update Ind PDU, and
thereafter resume other PDUs being enqueued again.
There can still be connection timeout if enqueued PDUs are
not being transmitted/acked during repeated retransmissions.
Updated bap_unicast_audio_acl_disconnect test to not use
random seed, to be similar to unicast_client test; to get
it to pass without overlapping state/roles casing connection
failed to be established after the changes in this PR.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix LLCP to use event_counter in the current event to
compare instant when trying to check instant passed on
reception of PDU with instant.
Fixes regression in commit e3e410aeed ("Bluetooth: Controller:
Fix LLCP event_counter value used during prepare").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>