Split lll_prepare and lll_resume from Nordic LLL to common file for
reuse by all vendors. The split also supports new JIT Scheduling by
defining a common place to calculate event prepare priority.
The module may also house other common parts of the LLL currently
re-implemented identically by vendors.
Signed-off-by: Morten Priess <mtpr@oticon.com>
The ticker 'force' flag is propagated via the ticker elapsed callback,
in order to provide necessary information for collision resolving in the
link layer.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Added config BT_TICKER_SLOT_AGNOSTIC which configures the ticker in
a "slot agnostic" mode, in which no collision resolving or slot
reservation is possible or used. In this mode, the ticker acts as a
simple timer.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Renamed to BT_TICKER_LOW_LAT in ticker, and changed selected
conditionally compiled code to use IS_DEFINED macro.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Replace k_work_cancel_delayable() with k_work_cancel_delayable_sync()
to make sure that the submitted work becomes idle before accessing
sensitive data.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit implements the secondary service
Audio Input Control Service (AICS) server and client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Both operands of an operator in which the usual arithmetic
conversions are performed shall have the same essential
type category.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Move the LLL done event handling from ULL to LLL, this
reduces CPU utilization and reduces overhead between radio
events.
Fixes#21993.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Defer the event early abort so that lll_done does not get
recursively invoked when called inside prepare callback.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
There is a race between the pipeline enqueue by the ULL
context when processing the LLL done event, and the
pipeline queue by the ticker timeout for a new radio
event. This caused an already enqueued event prepare to be
placed after the newly arrived request to enqueue a prepare
by ticker timeout.
Fix this race by placing the new prepare in the pipeline
instead of starting the event, when ULL is still processing
the LLL done event.
As ticker timeout and ULL processing of LLL done event are
in the same ULL_HIGH context, the pipeline handling is safe
with the order of prepares maintained correctly.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Commit d6c34c4644 changed the behavior
slightly but didn't update the documentation. The callback will now be
reset to NULL once the key is generated. Calling bt_pub_key_gen()
multiple times before the key is finished would result in creation of an
infinite loop. This could happen when an application calls mesh_init()
and mesh_reset() in quick succession. Clarify the behavior of the API in
the documentation.
Also passing a NULL argument would result in an undefined behavior, so
add a check to match the behavior described in documentation.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Change to use the BT_ATT_FIRST_ATTTRIBUTE_HANDLE and
BT_ATT_LAST_ATTTRIBUTE_HANDLE instead of the literal values where
applicable.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_iso_chan_disconnected assumes a CIS, but was
also used for BIS, so whenever it was called it attempted
to get a non-existing ACL connection.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The implementation of blocking calls is common for all the client
models.
This change reduces the code duplication by introducing new API that
helps to manage acknowledged messages.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The k_mem_slab_init() calls create_free_list() which checks
the slab block alignment. Noticed with Intel ehl_crb board,
which is 64-bit architecture, that the k_mem_slab_init() fails
because the log_strdup_buf items were not aligned properly.
This commit adds the alignment requirement to log_strdup_buf so
that the elements are alignment properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The check for NULL was on the pointer to the pointer,
rather than the pointer. The pointer of the pointer would
always be non-null, but the pointer might not be.
Moved from using a pointer of a pointer to just a
pointer to make it easier to read and understand.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds two functions:
1) Lookup periodic adv sync object by address
2) Get information about a periodic adv sync object.
These can be useful for the application verify if there is already an
existing sync to an periodic advertiser.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
During debugging I got "Got unexpected PDU" errors because a new CF was
received before the state was set to ISOTP_TX_WAIT_FC in the send state
machine. Setting the state before printing the debug information fixes
the issue.
Signed-off-by: Martin Jäger <martin@libre.solar>
Fixed addressing as specified in ISO 15765-2 encodes the source and
target address of a device or function inside the CAN ID according to
SAE J1939.
In order to allow to receive incoming requests from different nodes,
the CAN filter mask has to be set such that the source address is
ignored in the receive context. In addition to that, flow control
frames have to be sent back to the actual source of the request, which
requires adjustments to the TX CAN ID.
This commit implements above features and thus allows ISO-TP to be
used in a network based on SAE J1939 or NMEA-2000.
Signed-off-by: Martin Jäger <martin@libre.solar>
ISO 15765-2 specifies that the CAN frame length for single frames and
the last consecutive frame may or may not be optimized to the actual
length of the PDU payload. The ISO-TP implementation should only
consider the information from the N_PCI section.
The previous implementation did not allow padding. With this commit,
padding is allowed by default and can even be required to be more
compliant to AUTOSAR standards.
Signed-off-by: Martin Jäger <martin@libre.solar>
This adds a new kconfig CONFIG_TIMING_FUNCTIONS_NEED_AT_BOOT so
that the timing subsystem can be initialized at boot, instead of
being #ifdef under thread runtime statistics. This will allow
other part of kernel and other subsystems to utilize the timing
functions.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add discovery of standard descriptor values. This provides a shorthand
instead of doing a read by UUID, allowing the application discovery
procedure to re-use the discover parameters for simple descriptors.
Fixes: #21489
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Adds a parsing mechanism for Composition data page 0 in the Config
Client API, and uses it in the shell module to parse the incoming
composition data.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
The first byte of the composition data status message is the returned
page index, not the status of the request. This is now reflected in the
API.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Make bluetooth.init tests for nRF platform pass again by adding ULL/LLL
stub functions, and fixing minor compile issues.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Adds a Kconfig option to set the minimum key size accepted
by this device. This can be used to e.g. enforce 128-bit keys.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Create net_l2_send() function which will be called by each L2
sending function so that we can catch all the network packets
that are being sent. Some L2 layers send things a bit differently,
so in those cases call the net_capture_send() directly by the L2
layer.
Add network packet capture call in receive side after the pkt has
been received by the RX queue handler. This avoids calling the
net_capture_send() from ISR context.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The "net mem" command did not print external net_pkt slabs
properly (the number of free net_pkt's was not printed).
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Show detailed information about network interface that is down,
only when user asks such information about one specific network
interface. This means that for "net iface" command only
"Interface is down." is printed but the command "net iface 1"
will print detailed information even if interface is down.
This helps to view the information and user does not need
to bring interface up to see the details.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add infrastructure to allow user to configure the system so that
all the network packets, that are sent to or received from a specific
network interface, are sent to remote system for analysis.
The captured network packets are placed as a payload in UDP packet,
which is then sent inside a tunnel to a remote host. The host can
then receive the packets and for example show them in wireshark.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add get/set helpers to store information whether the net_pkt
is captured already or not. This bit is used to detect capture
loop and avoid recursion.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of forcing net_pkt_clone() use the tx_pkts slab, use
the same slab that was used when allocating the original net_pkt.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IPIP tunnel capability bit helps to detect which network
interface supports IPIP tunneling.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Implement SO_BINDTODEVICE socket option which allows to bind an open
socket to a particular network interface. Once bound, the socket will
only send and receive packets through that interface.
For the TX path, simply avoid overwriting the interface pointer by
net_context_bind() in case it's already bound to an interface with an
option. For the RX path, drop the packet in case the connection handler
detects that the net_context associated with that connection is bound to
a different interface that the packet origin interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
An option has been added which can be passed to setsockopt
which allows the user to set & get the dtls handshake timeout,
either before first handshake or online.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>