There's not need to mark advertising set as created by either legacy
or advertising command since this is determined by current so-called
HCI advertising mode which determines whether host uses legacy or
extended advertising commands.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
As per Core 5.2, Part B, section 3.1.1 controller should not allow
mixing of legacy and extended advertising commands. Once 1st command
is received from host, we should only allow commands of the same type
and return an error on other commands.
If legacy advertising interface is selected by 1st command received,
we need to make sure that set with handle=0 is created since it's
used by all legacy commands.
When not using external host, we assume that only extended advertising
interface will be used thus all checks can be skipped (optimized and
compiled-out).
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
A lot of commands return CC event with status parameter only, especially
when error is returned. This patch adds a helper to create such event,
similar to cmd_status.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Proper error code should be returned if advertising set with given
handle does not exist instead of generic "invalid parameters" one.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Expose the exFAT support option to Kconfig, so developer can
enable/disable the exFAT support on FatFs through Kconfig, no need to
touch ffconf.h.
Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
This macro has no use in code and was most probably replaced by
FSM_TIMEOUT (which resolves to CONFIG_NET_L2_PPP_TIMEOUT) with the same
default value.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Those macros are not used anymore after commit 35a2519091 ("net: l2:
ppp: add generic function for handling Conf-Req"), because we no longer
need preallocated table on stack for parsing option information.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This option is not used after commit 50b2cafc42 ("net: l2: ppp: use
net_pkt API for replying to Configure-Req") has been applied. We don't
need to preallocate table on stack for parsing option information, so
information about maximum number of supported options is useless.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
AdvA in extended advertising PDUs is put at different offset than in
legacy PDUs thus it's better to let caller calculate and pass AdvA and
TxAdd explicitly. This way we won't need to check whether scan request
was on legacy or extended PDU every time.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
When a connect indication contains a channel map of all zeros, the
adv->conn is left NULL'ed after return and next connect attempt leads
to a crash.
This was identified via the Sweyntooth test suite executing the script
re. issue 6.14 towards an Oticon target.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit allows let build zperf sample with overlay-netusb.conf.
USB subsystem must be enabled by the application.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
usb_enable() must be called by the application.
The application may want to register usb_dc_status_callback
and trace usb status codes (usb_dc_status_code).
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Tracing backed is not checking if the chosen backed specifies
the init function and is asuming its always present which could
not be true.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Open Supervised Device Protocol (OSDP) describes the communication
protocol for interfacing one or more Peripheral Devices (PD) to a
Control Panel (CP). The PDs are slave devices that waits for commands
from a CP. The communication happens over a RS485 multi-drop connection
with specification for a secure channel communication.
This patch adds initial support for OSDP in PD mode without secure
channel.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
USB device shall be able to send only in CONFIGURED state.
Zephyr USB HID device class allows to send the data no matter
of the USB state what is wrong. Attempting to write to endpoint
buffer in state != CONFIGURED may lead to driver error.
This patch introduces state tracing for USB HID class and
allows to send data using hid_int_ep_write() class API
only if the device remains in CONFIGURED state.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This override header declares structures and inline functions, which
must be given C language linkage to avoid conflicting declaration
errors with other headers.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Move call to reset_pairing to bt_conn_security_changed, since this
should always be done at the same time, and should be done in the same
order for all calls. For auth_complete this was reset after the
callbacks, which is inconsistent with the other events.
Also call it even if not connected anymore, the disconnection complete
event will be delivered after this event. Callback should alway be
called if security was initiated.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit adds comment clarifying how does DTS chosen node,
'zephyr,shell-uart', impacts default value of option assigning UART
port to the shell.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
For platforms using non-native stacks, net_tcp_init() should be
compiled out, similar to how it is done in tcp_internal.h.
Fixes#27463
Signed-off-by: Vincent Wan <vwan@ti.com>
Added support for syncing to periodic advetisements.
The API and usage is heavily inspired by the extended advertisement
and connection APIs.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Added the ext adv report interval to bt_le_scan_recv_info which
denotes whether or not there is periodic advertisement data
associated with the advertisement report.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Added API to set periodic adv parameters, periodic adv data
and to enable/disable periodic advertisement.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
When FAT FS option is enabled, then the FAT FS sub-menu will appear
next to it, instead of appearing far down the list.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
It does not auto-initiate the DLE procedure if the default data length
parameters are not equal to the initial parameters.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Some controllers do not follow the recommendation of auto-initiating
a data length update if the host writes default data length parameters.
If the controller follows this recommendation, calling
LE Write Suggested Default Data Length command is sufficient
to ensure that the LL will auto-initiate the DLE procedure. Performing
a second procedure is unecessary.
In Core v5.2, Vol 4, Part E, Section 7.8.35:
The HCI_LE_Write_Suggested_Default_Data_Length command allows the
Host to specify its suggested values for the Controller's maximum
transmission number of payload octets and maximum packet
transmission time for packets containing LL Data PDUs to be used
for new connections. The Controller may use smaller or larger values
for connInitialMaxTxOctets and connInitialMaxTxTime based on local
information.
In short, this command sets connInitialMaxTxOctets
and connInitialMaxTxTime.
In Core v5.2, Vol 6, Part B, Section 4.5.10:
For a new connection: connMaxTxOctets shall be set to
connInitialMaxTxOctets and connMaxRxOctets shall be chosen by the
Controller. If either value is not 27 then the Controller should
initiate the Data Length Update Procedure at the earliest practical
opportunity.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Fix issue with bt_gatt_service_unregister not clearing CCC information.
If the service is unregistered while an unbonded peer is connected and
subscribed then this CCC would be restored again when registering the
service even if the peer is now disconnected.
If the service is unregistered with bonded peers CCCs stored in settings
then this value would never be cleared. If the service is registered
again then the peer would receive a service changed for this service,
but it's CCC value would still be enabled.
Fixes: #26924
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Extract enqueue of GATT CCC when CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE
is enabled to a helper function gatt_ccc_conn_enqueue so that it can be
reused.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Move the clear_ccc_cfg function further up to be re-used without a
forward declaration in bt_gatt_service_unregister.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
va_list was initialized once and passed to log_backend_put_sync_string()
for each logging backend. State of such va_list was changed in each
execution, resulting in different va_list state to be passed for
consecutive log_backend_put_sync_string() calls. This results in
undefined behavior and program crashes.
Use va_copy() to copy va_list state to temporary variable for each
logging backend and keep original va_list untouched. Pass such temporary
state to log_backend_put_sync_string() to make sure state for all
consecutive calls does not change.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Instead of just showing network interface pointer, print also
network interface index. This helps debugging.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Starts the periodic heartbeat publish period at the end of the
publication, instead of at the ordering time. This ensures that the
heartbeat period doesn't get shortened by other enqueued messages.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
OT_RADIO_CAPS_SLEEP_TO_TX was added as a radio capability
for ieee802154 radio. Waiting on RX state before transmission
is alternative condition to OT_RADIO_CAPS_SLEEP_TO_TX support
as it was a result of OpenThread architecture and is actually
not needed in the Zephyr. Such change lets to start transmission
faster and lower SED device power consumption in active state
about 30%.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Enable the new TCP stack as a default one in order to get people
to use it before Zephyr 2.4 is released.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Zephyr platform does not support MAC retransmissions on its own,
so OT_RADIO_CAPS_TRANSMIT_RETRIES capability was removed.
It should not be enabled basing on IEEE802154_HW_CSMA support,
as these are quite seperate features. Current implementation
assumes that platform performs retransmissions on its own,
what is not provided and leads to lack of MAC retransmissions.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Allow user to enable CONFIG_NET_PKT_TXTIME and
CONFIG_NET_PKT_TXTIME_STATS at the same time. This will increase
memory consumption but as the CONFIG_NET_PKT_TXTIME_STATS is
only meant to be enabled for debugging purposes this overhead
can be accepted.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In TCP, we increase the net_pkt refcount in order to resend
it later if we do not receive ACK in time. Because we are not
getting a new net_pkt, the TXTIME statistics would be calculated
incorrectly. So if we re-send, reset the net_pkt creation time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add extra net_pkt RX timing information to "net stats" command.
You neeed to enable CONFIG_NET_PKT_RXTIME_STATS and
CONFIG_NET_PKT_RXTIME_STATS_DETAIL config options.
The "net stats" command will print something like this:
Avg RX net_pkt (7) time 459 us [0->23->16->257->160=456 us]
The extra stats is the end of line inside brackets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add extra net_pkt TX timing information to "net stats" command.
You neeed to enable CONFIG_NET_PKT_TXTIME_STATS and
CONFIG_NET_PKT_TXTIME_STATS_DETAIL config options.
The "net stats" command will print something like this:
Avg TX net_pkt (5867) time 82 us [0->33->20->27=80 us]
The extra stats information is the end of line inside brackets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Collect information how long net_pkt has travelled in IP stack
in certain points. See network documentation what these points
are and how to get information about the timings. This initial
commit adds support to TX timing collection.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>