On some content-types, it might be impossible to
send strings with size of zero.
Therefore empty URI should also allow cases
where strlen() is zero.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When the AUX_ADV_IND and AUX_SYNC_IND are close to each
other, the duration between them is not sufficient to
schedule a new instance of ticker to establish
synchronization. This processing time introduces latencies
detected by the prepare callback.
When the sync offset is low, schedule the start of the
reception to next periodic interval.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing PPI to timer start compensation and missing
inclusion of range delay in the calculation of packet
header receive timeout value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Extended Advertising Parameter check to exclude legacy
high duty cycle directed advertising from validating the
intervals as advertising interval parameter values are not
applicable for high duty cycle directed advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If no callbacks have been registered then callback_list
is NULL, in which case we can skip searching.
This also fixes a NULL-pointer acces in the while loop
as previous_callback would be NULL when it gets
dereferenced as previous_callback->_next.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BIGinfo PDU bitsets were not accessed in a portable maner for
endianness independence, and need to be handled as bit-manipulations.
Add utility functions to access PDU bitset variables independent of
endianness. Use macros to abstract the offsets and widths.
Conversion of BIG_Handle to LE in HCI layer incorrectly use
sys_cpu_to_le16, which fail because target type is 8-bit.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Fixes commit a9a82d557c ("llext: use elf_rela_t instead of elf_rel_t")
Also switch sign of (unused?) `r_addend` to unsigned.
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.reloc.html
Issue found thanks to the following warnings when compiling in 64bits:
```
/__w/zephyr/zephyr/include/zephyr/llext/elf.h:349:29: error:
right shift count >= width of type [-Werror=shift-count-overflow]
349 | #define ELF64_R_SYM(i) ((i) >> 32)
```
The name `elf64_word` was admittedly confusing.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Note `elf64_addr` and friends are defined as uint64_t which is defined
as `long long unsigned` which is for some reason different from
`size_t`. So they all require a cast.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
With recently introduced DNS retransmission mechanism, a certain bug
could occur when calculating query timeout.
If the time until the final DNS timeout (as indicated by
CONFIG_NET_SOCKETS_DNS_TIMEOUT) was less than 1 millisecond, the actual
millisecond timeout value was rounded down, resulting in 0 ms timeout.
This in order was interpreted as invalid argument by dns_get_addr_info()
function, so in result, instead of reporting query timeout, the function
reported invalid argument error.
Fix this by rounding the millisecond timeout up, instead of down, so
that in any case, if the final timeout is not due, we always provide
non-zero timeout to dns_get_addr_info().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When the broadcast sink is stopped, the sink was also
set to NULL via
default_broadcast_sink.bap_sink = NULL;
However the lifetime of the broadcast sink does not
follow the state of the streams, and it still exists
afterwards. The broadcast sink can only be terminated
(deleted) via the term_broadcast_sink command.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds the CAP Commander Change Microphone Gain procedure.
This procedure changes the microphone gain on one or more
CAP Acceptors.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Two places we did not have an error check from calling
bt_bap_ep_get_info before accessing the result. These
have simply been added (without an else), as they are
(very) unlikely to fail.
This was caught by coverity and thus fixes those
coverity issues.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Currently, the upper layer cannot know
whether the data is successfully sent
through DLC.
Add a field "sent" for RFCOMM DLC ops.
Notify upper-layer of the sending
result through the field "sent".
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add structured logging support to syslog backend. This means
that meta data can be included to logging output.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to configure the syslog net backend to use TCP
instead of UDP. The syslog server address for TCP needs to
have "tcp://" URI in front of the address, for example the
tcp://192.0.2.2 server address would use TCP as a transport.
If there is no URI, then UDP would be used by default.
See the relevant RFC at https://www.rfc-editor.org/rfc/rfc6587
for details.
Fixes#66728
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Current TELNET implementation wrongly assumed that if the command is
present, it will always be included at the beginning of the packet/data
buffer. Such assumptions however are not valid for STREAM sockets,
where the actual stream data could be fragmented in any way.
Therefore, the command parsing needed rework, so that we analyze each
byte received for the command escape code, and once received we enter
"command parsing" mode. Once no more commands are identified in a data
streak, the command bytes are removed from the data buffer before the
buffer is provided to the shell subsystem for processing.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rework TELNET shell backend to use socket API for communication and
socket service library for socket monitoring.
Additionally, rework the TX part so that non-blocking TX is used when
sending from the system work queue. In case transfer is not possible at
the moment, the TX work is rescheduled instead of blocking the system
work queue.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Socket service pollfd count should not exceed the configured
NET_SOCKETS_POLL_MAX limit, as poll() will not be able to monitor
sockets beyond that limit anyway. Adding +1 there prevented the library
from catching the configuration error.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
By default `GDBSTUB_SERIAL_BACKEND` will be selected as it's the only
option here. This can cause problems for code that wants to provide its
own custom backend. Add a choice for a custom backend.
Signed-off-by: Robert Zieba <robertzieba@google.com>
Remove redundant depends on statements for SEGGER_SYSTEMVIEW.
This is already inside an if SEGGER_SYSTEMVIEW so depends on are
already added.
Signed-off-by: Joakim Andersson <joakim.andersson@heimdallpower.com>
The fix is to check if any of the adv set's rpa expired
callback returns false, then all adv sets continues with
the old RPA.
Note: Fix is applicable only to adv sets which shares the
same id.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
Commit adds const qualifier to models metadata.
Specification claims: Composition Metadata Page 0
shall not change during a term of a node on the network.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Codecs can be printed at different levels:
level 0: Generic and unicast
level 1: subgroup codec configs
level 2: BIS codec configs
This commit ensures that the indentation level
is correctly increase based on where the codec configuration
data is printed.
This also updates the documentation for the BAP shell.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
print_codec_cfg and print_codec_cap has been modified to print the
codec metadata in a more human-readable way, so it is easier to read.
This also adds the (final) human readable support when
parsing and printing BASEs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
print_codec_cfg has been modified to print the codec configs in a more
human-readable way, so it is easier to read.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
print_codec_cap has been modified to print the remote caps in a more
human-readable way, so it is easier to read and understand the remote
server's capabilities.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the broadcast_sink_streams to be an array of shell_stream
instead of bt_bap_stream, so that it can be used in a similar way
as the rest of the streams.
To help the transition, a new helper function,
bap_stream_from_shell_stream, was added.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add additional logging in past_available to easily see the PAST
support of the broadcast assistant and scan delegator devices.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function did not have a NULL check for the parameters,
and thus did not fail correctly on invalid input.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The simple test is there to test the API and simple extensions in
unison. Hello world was intended to be the first not the only extension
being tested.
Also refactors the entry thread to allow for usermode potentially by
passing the pointer to the function symbol rather than having it look it
up directly.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
When we receive the subnet mask option from the server, we
cannot yet set the netmask to the network interface as the
mask is tied to the IP address we received from the server.
We need to delay the setting of netmask until we have added
the requested IP address to the interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Adds a function to set the syslog server ip with a struct sockaddr,
so that it can be set without a string.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
In case the LL address is not set on a packet for any reason, don't try
to access address structure to determine packet type.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Shell stack size is too low for OpenThread without joiner
functionality, causing overflow.
In this commit, the value of stack size is not changed.
Incorrect assigning of value for opentrhead with
no joiner functionality has been removed.
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
A few paths used only when there is Coded Phy support were
still setting the subscribe registers directly.
Let's use the nRFx HAL for this so it works properly also
in simulation.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Quite a few paths used only when there is Coded Phy
support were still setting the PPI directly.
Let's use the nRFx HAL for this so it works properly also
in simulation.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In case the same callback handler is added to the list twice, this can
result in a loop.
Fixes: #69825.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
In iperf2, for multicast data, if it is a client, it will not wait for
the server's AckFIN packet. Because the iperf2 server will not send an
AckFIN packet.
So in zperf_upload_fin(), an error will occur when the zperf client
waits for the server's AckFIN packet.
Multicast only send the negative sequence number packet and doesn't
wait for a server ack can fix this issue.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
During manual testing with UBSAN enabled, it was found that
bt_le_per_adv_sync_cb synced() callback in application
sometimes gets unexpected different values in
`sync_info.recv_enabled` field.
The UBSAN output contained the following warnings message:
runtime error:
load of value 65, which is not a valid value for type '_Bool'
It tunrned out that struct bt_le_per_adv_sync_synced_info sync_info
inside bt_hci_le_past_received_common() contains uninitialized
recv_enabled member.
Set it to true by default to avoid possible issues.
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>