The commit adds flash_area_sectors function that allows to get information
on sector/erase page layout by flash_area object pointer instead of
index.
The only difference between flash_area_sectors and flash_area_get_sectors
is that the later calls flash_area_open internally and as such requires
flash map to be compiled in.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds FIXED_PARTITION(label) macro that allows to obtain
struct flash_area object for partition of given label.
The macro allows instantiation of partition at point of usage
and will be replacing need for defining flash map with all partition
entries.
Area obtained with the macro should not be passed to open, instead
flash_area_device_is_ready, basically equivalent of device_is_ready
should be called on the obtained pointer to check if area is ready
for use.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Because the number of ACL RX buffers must be at least the number of
maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could
inadvertently lead to a build failure if the number of ACL RX buffers is
not also increased. This dependency may not be obvious to users.
To address this issue, this commit deprecates the
`CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in
`buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default
value and the minimum range value have been changed to 0 to "disable"
the option.
Additionally, to allow users to increase the number of ACL RX buffers,
this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig
symbol. The value of this symbol will be added to the computed value of
`BT_BUF_RX_COUNT`.
The configurations of tests and samples have been updated to reflect
these changes.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
when receiving the io cap request from controller, call
pairing_accept to check whether application accept the
pairing. If no, reply BT_HCI_OP_IO_CAPABILITY_NEG_REPLY.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
The check combination of "is zero" and then "less than zero" leaves open
the theoretical possibility of a positive return value, which would
continue on with an uinitialized 'rela'.
Checking for "not zero" has the same effect and covers all situations.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Fix CIS offset calculation by Central for subsequent CISes
such that when compensating for dissimilar ACL and ISO
intervals, ensure that minimum offset does not cause a
collision between the ACL and the CIS event at the instant.
Fixes commit 3b3d53f09e ("Bluetooth: Controller: Fix CIS
offset_min for dissimilar interval").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Several arguments were added but have not yet been aligned with others
in the same function. Hence, use `getopt_state` to access `optarg`,
offering a better alternative to direct global access.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This API gives better control on L2CAP COC credits and suits better
for Upper Tester implementation.
Co-authored-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This fix calling seg_recv() callback being called even though channel
is being disconnected due to SDU overflow.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Fix ISO Sync Receiver implementation to correctly prevent
subevent from pre-empted in the unreserve time space.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO Sync Receiver time reservation calculation to use
peer broadcasted bis_spacing and sub_interval, instead of
incorrectly calculating using local implementation used
tMSS value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO Sync Receiver implementation to correctly reflect
the payload number and timestamp for the skipped SDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The ctx_shell was only used a single place and in a function
that already has a `sh` that would be better to use.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There is no point in using lock or semaphore to read current
usage counter as it may change after unlocking or giving
back the semaphore. Value can only be trusted in the controlled
environment (e.g. test).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The ASCS unit tests had various errors after adding support for
dynamic registration.
Several tests did not properly clean up after failure, causing other
tests to fail when they shouldn't.
Moved the register tests to their own file as they should not
do the register in the "before" function.
The test_ascs_unregister_with_ases_in_config_state test was also
removed, as it had both issues and the state that it wants to test
cannot be reached with the current API - It is not possible to
put an ASE in the configured state without callbacks,
and registered callbacks prevents us from calling
bt_bap_unicast_server_unregister to trigger the case as that can
only be done if callbacks are unregistered. Since unregistering
callbacks also puts all ASEs to the idle state, it is not possible
to call bt_bap_unicast_server_unregister for a non-idle ASE.
The testcase.yaml was also missing some Kconfig options to
properly enable the client tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of requiring one big buffer for formatting the output,
have a walk function that can be used to generate output by
one metric at a time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add collector parameter to metric creation macros so that it
is possible to bind the metric to collector already at built
time.
Also add optional user_data to metric macro calls so that user
can add optional data there. This will be used by network statistics
Prometheus support in subsequent commits.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Embed "struct prometheus_metric" to individual metric like
counter, gauge, histogram and summary. This way we avoid having
a separate base pointer in specific metrict struct. We also do
not need to search the specific metric from base metric as
we can simply use CONTAINER_OF() macro to get the base metric.
This embedding means that the counter, gauge, histogram and summary
metric define macros are changed as user does not need to create a
separate "struct prometheus_metric".
Convert the tests and sample to use the new macros.
Remove also the static from metric creation macros so that user
can decide whether it needs collector to be static or not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This is similar function as add, but will add the difference of
previous value and the new one. This can be used if we want to
periodically update the value with a new one but don't want to
keep track of the old one.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This addresses the following warning building with `CONFIG_64BIT=y`:
error: format '%hu' expects argument of type 'int', but argument X has
type 'size_t' {aka 'long unsigned int'}
Signed-off-by: Chen Xingyu <hi@xingrz.me>
bt_le_set_auto_conn() function is not working as
expected. Also, it doesn't have any test coverage
and any usage in sample applications.
The function is deprecated
Fixes#81597
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
bt_conn_le_create logs a warning if the provided conn is
non-NULL which was the case here. Simply set it to
NULL as it is a local variable.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When CONFIG_ASSERT is enabled, assertion for unbalanced state lock
get/put is triggered. This commit leverages shi drivers from other
SoCs to resolve the assertion.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for sap.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
Add implementation for Extended Advertising Auxiliary PDUs
to use ticks slot window feature.
This will allow the periodic scheduling of AUX_ADV_IND PDUs
to drift upto 10 ms advertising delay minus the ticks_slot
time reservation of the AUX_ADV_IND PDU when overlapping
with other states/roles that cannot be moved around, to
avoid skipping them.
Having an active Extended Advertising simultaneously with
an ISO Synchronized Receiver or Connected ISO connection
will now have less ISO SDU loss when using 10 ms ISO
intervals.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Introduce ticker reschedule with drift so that role like
AUX_ADV_IND can start after overlapping states and roles
using time reservations.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix to reschedule before overlap and be collision resolved
in the next periodic interval for tickers using slot window
yield.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add support for IP_LOCAL_PORT_RANGE socket option. The option
supports both IPv4 and IPv6 sockets although the type is IPPROTO_IP.
The option can be used to enforce the ephemeral port number selection
to be in certain range.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The ICBMsg backend divides its memory into
blocks. Each block is aligned to data cache
alignment. Is it not required, since adjacent
blocks has the same data flow direction (either
read-only or write-only). This commit changes
it to 32-bits making wasted memory significantly
reduced.
Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
This addresses the following warning building with `CONFIG_64BIT=y`:
error: field precision specifier '.*' expects argument of type 'int',
but argument X has type 'size_t' {aka 'long unsigned int'}
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Remove the deprecated HCI driver API which was provided by the hci_driver.h
header file. The deprecation happened in Zephyr 3.7, so the API can now be
removed for Zephyr 4.1.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Change in default flash map generation, where partitions hanging of
disabled devices will not have flash area generated.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit changes the BSIM tests to use the same recv callback
for all tests. The purpose of this is to reduce code duplication
and make it easier to maintain the tests.
This also changes the recv_cb so that in case of any error we log
the most recently received SDU, which should provide more
information about why a test failed in case of RX error.
PBP had to be updated a bit to support the audio_stream
struct.
Also modifies a check and log in bap_stream that was less than
helpful to determine if it was the stream or the endpoint that
was NULL.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Non-confirmable CoAP requests need lifetime tracking as well
so we can free the structure after a timeout.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>