The osFlagsWaitAny option is not handled correctly. It returns once any
flag at all is set, whereas it is supposed to only return once one of
the flags specified in flags is set.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
Validate that a received LL_CIS_REQ is valid and reject if it is not
Fixes EBQ test failure in LL/CIS/PER/BI-07-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
Fix credential store corruption issue caused by missing
security type checks. Add support for all valid security
types to ensure credentials are parsed correctly.
Fixes#88261.
Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
In my opinion, the user is supposed to configure the speed of the stack
and drivers ough to honor that choice. However current Zephyr USB
maintainer imposes that the dependency is the other way round, i.e.
that user first needs to disable High-Speed chirp at driver level and
only then can select Full-Speed only operation. Adhere to the
arbitrarily set up rule to allow this really necessary functionality to
enter Zephyr.
I consider this change to be harmful because it opens up a Kconfig trap
that allows configuring High-Speed capable stack with a device driver
limited to Full-Speed only operation.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Allow compiler optimizations to remove High-Speed handling code. Knowing
that maximum operating speed is Full-Speed allows to reduce bulk buffers
from 512 to 64 bytes. More RAM optimizations are possible but this
commit only gets the low hanging fruits.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Two main ideas behind setting maximum speed are:
* Allow code and RAM optimizations at compile time
* Allow High-Speed capable drivers to limit operating speed to user
choice.
This commit only introduces the necessary Kconfig options but does not
implement any code or RAM optimizations and does not modify any driver.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The `sh_mqtt_rx_rb_flush` function was intended to flush `rx_rb` when
get an error return from `mqtt_read_publish_payload_blocking`.
Instead of retrieving values from `rx_rb` one by one, calling
`ring_buf_reset` achieves the same result more efficiently.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Introduce a local pointer, `struct shell_mqtt *sh`, to minimize access
to the module-scoped `sh_mqtt` variable.
This allows `sh` to be stored in a CPU register, resulting in more
compact code and improved execution efficiency.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
- Modified conditions in WIFI_CONNECT()
function to reject SAE password and
PSK based on length parameter
Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
only accept new connections until the configured value for concurrent
connections is reached. Also set the backlog of the listening socket
to the configured value.
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
Add bt_ccp_client_get_bearers that will return the bearers of
a client so that the application can always retrieve them if they
do not store them from the discovery callback.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix the kconfig check for enterprise crypto support in AP mode.
Also, remove the unnecessary Hostapd enterprise crypto check in
credentials code.
Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
IPPROTO_RAW is not a valid protocol type for AF_PACKET sockets, which
should only use IEEE 802.3 protocol numbers. Therefore remove support
for this type of sockets.
As an alternative, users can use AF_PACKET/SOCK_DGRAM or
AF_INET(6)/SOCK_RAW, depending on the actual use case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce changes in the networking stack which allow to create raw IP
sockets, so that applications can send and receive raw IP datagrams.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Register connection type along with family and protocol, so that it's
possible to differentiate between connection listening for raw IP
datagrams and TCP/UDP/other packets.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Private Node Identity advertisement on a subnet should stop as soon as
the network is removed.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
When core is suspended and power mode has non zero exit_latency_us
a system timeout will be rescheduled to a point in time that is
earlier by exit_latency_us than request. It is to accommodate for
lengthy resuming procedure which would cause requested timeout to
be significantly late. However, setting additional wake up point
has cost, it is one more redundant core wake up and that impacts
performance and power consumption.
Add Kconfig option to chose what conversion method is used. It has
the biggest impact on small exit_latency_us where conversion may
result in 0 ticks (no pre-wake up) or 1 tick (wake up).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Some OpenThread functions were called without verifying the return
value, which not only is not the best practice, but also could lead to
build warnings with llvm. This commit fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixed the bt_pacs_get_available_context API to return values of type
bt_audio_context instead of an error type.
Signed-off-by: Dereje Wassie <deiw@demant.com>
Allow replacing the default naming scheme of the stored settings by
providing a custom function that fills a name buffer based on the ITS
entry UID.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The rule says there must not be spaces "between a command and the opening
parenthesis".
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Previously, when detecting the GC_done ATE the gc_done_marker boolean
variable was not set.
Fix this by setting it to true if the GC_done ATE is found.
Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
Rewrote places in the bluetooth code that converts objects
larger than one byte by taking the address of an unaligned struct
member and changed it to a function that takes the value directly
and converts it to big endian.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
`>= 0` was used when EATT support was implemented (#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR #67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
`att_sent` is removed as it does not provide any value. All checks are
already performed in `att_on_sent_cb`, and keeping it only increases
readability complexity.
`att_sent` is removed as doesn't give any value. All checks are done
already in `att_on_sent_cb`. It just increases readness complexity.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The extra `bt_att_chan_req_send` does nothing but increases readability
complexity. All checks are already performed by the caller.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The existing checks were not thread safe at all.
Replace the checks by using atomic_test_and_set_bit
and then clearing the bit again on error.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In bt_sco_disconnected, chan->sco is set as NULL before callback. Then
hfp disconnection callback use it to callback to application in
hfp_hf_sco_disconnected.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
When CONFIG_ZTEST_FAIL_ON_ASSUME is set, a failed assumption will
cause the suite to fail, but the individual test will be marked as
SKIPPED. We should fail the test so it's clear what's going on.
Fixes#86611
Signed-off-by: Yuval Peress <peress@google.com>
gcc 11.4.0, seems to believe this variable may be used uninitialized,
and warns about it (causing a test build failure due to warnings
being treated as errors).
Let's just initialize the variable to 0 to avoid the issue, as the
cost is trivial.
subsys/bluetooth/host/classic/hfp_ag.c: In function
‘bt_hfp_ag_vts_handler’:
1095
subsys/bluetooth/host/classic/hfp_ag.c:3091:17: error: ‘code’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
1096
3091 | bt_ag->transmit_dtmf_code(ag, code);
1097
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098
The issue can be reproduced for ex. with:
$ mkdir build ; cd build
$ cmake -GNinja -DBOARD=native_sim/native/64 ../tests/bluetooth/shell \
-DCONF_FILE="prj_br.conf"
$ ninja
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The default thread priority for the CoAP client thread is set to
NUM_PREEMPT_PRIORITIES which is not a valid thread priority, as the
lowest application thread priority is actually
NUM_PREEMPT_PRIORITIES - 1. Because of this, CoAP client library gave an
assert on boot if assertions were enabled.
Kconfig does not allow for arithmetics when setting integer defaults,
therefore handle this at the preprocessor stage by limiting the actual
priority assigned to the CoAP client thread to a valid range.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add CONFIG_NET_CONN_PACKET_CLONE_TIMEOUT to allow for longer
timeouts. This can be used to prevent dropping packets when
transmitting large amounts of data (with PPP).
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
When sending the close command as a server, the data is incorrectly
masked which violates RFC6455 section 5.1.
Use the is_client flag to avoid masking if the close is for a websocket
server.
Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
While linking with the IAR linker using generated linker scripts,
and with errors if unhandled sections are encountered, many of the
bluetooth tests failed because CONFIG_SETTINGS was not set.
The section that was not handled was
'._settings_handler_static.static.settings_handler_bt_ccc_'
Now it's only set if CONFIG_SETTINGS is set.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
The current mapping gets the network interface into dormant state when
Thread is not attached. While the node is not capable of doing multi-hop
communication when it's not attached, it should be able to do link-local
communication. This commit changes the mapping to look at OpenThread's
own network interface state instead without further checking Thread's
device role, so that link-local communication is supported when a node
in detached state.
Signed-off-by: Yakun Xu <xyk@google.com>
Previously bis_sync_req was only called when requested_bis_sync
was changed. However that meant that there were cases where the
requested_bis_sync was the same as the new request, but where
the actual BIS sync state were different. This was mostly
the case when the scan delegator had autonousmly
added or modified the receive state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The scan_delegator_mod_src accidentally may have overwritten
the value of internal_state->requested_bis_sync before the
entire request had been verified, causing a mismatch between
what the application knows and what the stack stored.
Fixed by storing the request in a temporary value until
everything has been verified and accepted.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updated implementation to use single receive thread to
enqueue HCI ISO data, ACL data and events towards Host when
building HCI-Only samples/applications, i.e. when building
hci_uart, hci_spi or hci_ipc samples (CONFIG_BT_HCI_RAW=y).
This implementation will serialize HCI events and data as
they occur corresponding to on-air timelines of their
occurrences which is how they are generated by the Link
Layer.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The error occur when discoverying br devices and need to send request_name
for many found devices.
In system work queue task, bt_hci_inquiry_complete->
report_discovery_results is called, then request_name is called for all
the found devices. The controller gives HCI_Remote_Name_Request_Complete
event for every name request result and one buf is allocated from
hci_rx_pool to save HCI_Remote_Name_Request_Complete. When system work
queue task is blocked to call request_name for every device, many
HCI_Remote_Name_Request_Complete are received for the already sent
request_name, it uses up all the buf of hci_rx_pool, then the bt_rx_thread
task is blocked to get buf from hci_rx_pool when next
HCI_Remote_Name_Request_Complete is received, meanwhile the next
request_name send hci cmd and wait the result, but the hci status/complete
event can't be received because the bt_rx_thread is blocked and
bt_uart_isr is kept in the state to receive last
HCI_Remote_Name_Request_Complete, then bt_dev.ncmd_sem is not released,
then the next request_name send hci cmd again, but the bt_dev.ncmd_sem is
invalid, then bt_hci_cmd_send_sync fail and assert.
resolve it by requesting name one by one.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
When an advertising set is not configured for periodic advertising,
the correct error to return is BT_HCI_ERR_CMD_DISALLOWED
Fixes EBQ test failure of HCI/DDI/BI-70-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
If the AG works as Data Channel Acceptor, the ACL conn cannot be known
by the application of AG. Similar with HF, add ACL conn as the first
parameter to the `connected` callback of AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>