Remove ticks_elapsed use in reschedule_in_window as it has
already been used in the bottom half processing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
During use of tests/bluetooth/shell application to perform
extended scanning with periodic advertising and broadcast
audio source devices around, it was observed that the
application crashed due to too low BT_RX_STACK_SIZE, hence
increase by 128 bytes.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix implementation of single switch timer minimum compare
value requirement. Do not always add the maximum possible
radio latency duration, but check if the required compare
value is smaller, then use the remainder required as the
extra compare value. This fix reduces latencies to setup
radio receptions and fixes an assertion in lll_scan_aux
when radio_tmr_start_us() is checked for latencies.
Relates to commit bcd28e0a86 ("Bluetooth: Controller:
Fix sw switch single timer for spurious TXEN/RXEN").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
add `ALLOW_EMPTY TRUE` property to silence cmake warnings in case
when no sources are added to subsys__net library
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
Seen when having multiple network interfaces that the sock_error
was 0 even if the socket was serviced properly. So if SO_ERROR
returns 0, just ignore it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We must register all listening sockets under one file descriptor
array when calling dns_dispatcher_register() which then calls
net_socket_service_register(). The socket services expects all
the registered sockets under one service context to be in one
array. If this is not done, the latest socket array wins and
the earlier registrations are forgotten.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As the DNS might listen to multicast addresses (like in mDNS) in
different network interfaces, make sure to check the network
interface index when registering the dispatcher context. This
allows two mDNS registrations to more than one network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Like 2ca179c, check and warn if incoming HCI event parameters exceed
the specification. This helps debugging controllers by detecting the
out-of-spec value that shouldn't appear.
Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
System lists are not thread safe, therefore all accesses should be
protected with a mutex. Introduce a LwM2M context specific mutex,
and use it whenever lists defined per-context are acessed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The LwM2M message allocation was not thread safe, i. e. the message was
acquired by setting the ctx pointer, and it was freed by clearing the
entire message structure.
If preemptive threads were enabled, and memset() clearing the message
content was preempted, the message structure being currently zeroed
migh've been allocated and initialized by some other thread. If the
thread releasing the message resumed work, it would continue clearing
the freshly allocated and initialized message structure.
In order to prevent this, introduce a new global mutex for the lwm2m
engine global variables. The mutex is used when LwM2M message is
allocated/deallocated. This will prevent reallocating the message
during the release process.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When shell is integrated with the logging frontend then pointer to
the logging backend in the shell structure is null. When null pointer
is found assume that it is a shell instance with logging frontend
integration and use frontend in the logging commands.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Shell is capable of acting as the logging backend and multiplex
logging messages with shell content. It expects that logging
messages goes through the logging backend. However, there is an
option that logs go only to the custom logging frontend. In
that case this default approach does not work and logging
frontend cannot be easily integrated with the shell (due to
its custom nature). Add Kconfig option SHELL_LOG_BACKEND_OOB
which prevent compilation of the default shell log backend.
When enabled, application can provide frontend specific
implementation to integrate shell with the logging.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add support for a "named event" trace. This trace is intentionally not
used by the system. The purpose of this trace is to allow driver or
application developers to quickly add tracing for events for debug
purposes, and to provide an example of how tracing subsystems can be
extended with additional trace identifiers.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.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 station.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
If AP indicates the presence of buffered traffic, then it is up to the
STA to decide whether to stay in PS or come out of PS, add configuration
options that can be used at runtime to choose this.
This is tagged as "noup" because it's a backport and "fromlist" cannot
be used as it won't apply cleanly.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
Add igmp.h file to declare definitions for IGMP that are not meant te be
included by the application but can be used in e.g. tests.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
According to RFC2236 section 2.5, the IGMP message may be longer then 8
bytes. The rest of the bytes should be ignored.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
The header length of the net ip packet was calculated using only the
net_pkt_ip_hdr_len function. The correct header length should be
calculated by adding net_pkt_ip_hdr_len and net_pkt_ipv4_opts_len. This
resulted in an incorrect IGMP version type in case of IGMPv2 message
(when IGMPv3 was enabled). The IGMP message was not parsed correctly and
therefore dropped.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
k_pipe_put_* functions should take const void* data
instead of void* data. This can lead to warnings at the
the -Werror=discarded-qualifiers compiler flag, because the
the input will be const void* and the parameter will be void*.
Fix it by replacing void* data with “const void* data”.
Signed-off-by: Bruce Rosier <brucerosier9@gmail.com>
This allows to select if device appearance requires encryption or
authentication or none. This makes it similar to what is implemented
for device name characteristic.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This makes it clear on how security requirements are set and avoid
confusion on how encryption and authentication are handled.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
When non-random number generation is allowed via
`TEST_RANDOM_GENERATOR`, enable an implementation for `sys_csrand_get`
that stubs out to `sys_rand_get`. This enables libraries that request
CS random numbers to be tested in CI, even if the results are not CS in
that context.
The documentation for `TEST_RANDOM_GENERATOR` is explicit enough about
the dangers of enabling this in production.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Regardless IO capabilities, clear MITM flag for pairing
initiator if the required security level is less than
BT_SECURITY_L3.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
All the remaining modules uses LOG_MODULE_REGISTER(<module>, <log level>)
Lets update the logging registration as the other modules are doing it.
Signed-off-by: Kiara Navarro <sophiekovalevsky@fedoraproject.org>
When Proxy advertising or PB-GATT Advertising Enabled and use a same
advertising sets.
As adv\_start will call multi HCI Command will cause syswork_q yield.
At same time, if another thread(BT RX) all schedule\_send will cause
unable send mesh message, because ADV\_FLAG\_ACTIVE was be set, but
ADV\_FLAG\_PROXY not set currentlly.
Add ADV\_FLAG\_SCHEDULE\_PENDING indicate mesh buf has been pendings
but not scheduled, so when proxy advertising enable, let's take again,
as we can't break or terminated adv\_start, so we must waiting proxy
advertising enabled.
But after https://github.com/zephyrproject-rtos/zephyr/pull/68558
The `k_work_is_pending` always true in `send_pending_adv`, which cause
unable to send more mesh message until more mesh message comming
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Adds HCI support for LE CS subevent result continue
event and the reassembly logic for the partial results.
When subevent results are completed or the subevent is
aborted, the user callback is invoked with a buffer
pointing to the HCI event buffer, so no copy is done.
When subevent results are incomplete, then a reassembly
buffer is allocated from a fixed sized pool. This buffer
is used for the reassembling of the subevent result
containing all of the step data, which is then passed
to the user via the callback. kconfigs have been added
to set the size and the count of the reassembly buffer.
Signed-off-by: Burak Gorduk <burak.gorduk@nordicsemi.no>
Rework NUM_SPATIAL_LOCATIONS() to evaluate to integer literal to allow
using it with LISTIFY() macro. This is necessary because Feature Unit do
not operate on channel clusters but rather on logical channels.
Track back Output Terminal channel cluster to appropriate entity. This
is necessary because Feature Unit does not repeat the channel cluster
information.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
MbedTLS specifically checks for null-terminator, else it skips PEM
format processing and tries to parse it as DER causing parsing failures.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This creates a websocket based shell backend that is used to
implement a websocket console that can be connected using a browser.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow logging output to websocket console. Requires that
websocket shell backend and websocket HTTP server support
is also enabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Move the CCID header to the include directory
to make it public.
This also compiles the ccid.c file whenver CONFIG_BT_CONN
is enabled, rather than having an additional Kconfig for it,
since the API is now public and may be used by other than
our internal services.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rather than throwing an assert, it will now do a better
check for already-allocated CCIDs and return an error instead.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
alloc_value is more correct as it does allocate a new
value, rather than just returning/getting a value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The 11v_btm_query shell command was calling parse_number() using
a pointer to uint8_t. This will cause memory overwrite and possible
crash. Convert to use long temporary value to avoid this.
Fix also the output prints in case of an error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Rework the wifi-shell code so that external subcommands can be
bolted into it easily. This means that the commands should be
created using SHELL_SUBCMD_ADD().
Place the various subcommands in alphabetical order to find them
more easily.
Split long lines in order to pass CI checks.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This change makes sure that when a call to `bt_id_set_scan_own_addr` is
sucessful, i.e., the return value is 0, the `own_addr_type` will
be set by the `bt_id_set_scan_own_addr`.
Not setting the `own_addr_type` in a successful call to
`bt_id_set_scan_own_addr` causes, for example,
the `start_le_scan_ext` method in `scan.c` to use an
uninitialized `own_addr_type`.
Eventually this results in an unexpected failure further down in
`start_le_scan_ext`, when sending HCI command to controller with
an uninitialized `own_addr_type`.
Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>