As per POSIX, for non-connection-mode sockets the peer address should be
reset if AF_UNSPEC family type is provided to the connect() call:
"If the sa_family member of address is AF_UNSPEC, the socket's peer
address shall be reset.""
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Use the native zephyr sys_clock_gettime() call instead of the XSI
gettimeofday(), since XSI is not required here and would normally
require CONFIG_XSI_SINGLE_PROCESS to be selected.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Allows returning image information for the firmware loader image
slot, showing version of the application and flags
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Commit f499ea0 made it so that the compiler optimization flags are also
passed to the assembler. However, this breaks for the IAR toolchain
since it uses the GNU assembler which does not have the same
optimization flags as the IAR compiler.
This commit separates the compiler and assembler optimizations to make
it possible to specify appropriate flags in a toolchains corresponding
`compiler_flags.cmake`
Signed-off-by: Daniel Flodin <daniel.flodin@iar.com>
This commit brings a shell command to retreive the following application
version information:
- APP_VERSION_STRING
- APP_VERSION_EXTENDED_STRING
- APP_BUILD_VERSION
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
A recent change triggered a warning in LLVM that was promoted to error
when run with twister.
```shell
goep.c:102:3: error: label followed by a declaration is a C23 extension
[-Werror,-Wc23-extensions]
102 | int err;
```
Add a scope to the switch case so that the declaration has proper scope.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
After the #93703 PR was merged we get a possibility to remove _node field
from bt_conn_cb struct if the BT_CONN_DYNAMIC_CALLBACKS option is disabled.
The list conn_cbs can also be safely removed by more macro usage.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
CONFIG_BT_CTLR_DATA_LENGTH_MAX should set its default value up to
and including the maximum value supported by the Bluetooth spec
(251 bytes).
Signed-off-by: Sam Friedman <sam@golioth.io>
According to the OBEX Version 1.5, the Name header could be a empty
string.
Update function `bt_obex_add_header_name` to support the case that the
length of name could be 0.
Update function `bt_obex_get_header_name` to support the case that the
name header is found but the name length is 0.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a TLV array `tlvs` to keep the pending TLV data.
Update `app_param`, `auth_challenge`, and `auth_rsp` to set the one
TLV information each time. When the optional argument `last` set,
write the all pending TLVs to the tx buffer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a structure `struct bt_obex_tlv` to pass/save the one TLV info.
Use a array of `struct bt_obex_tlv` as the set of all TLV-triplets.
Update the following functions to support the feature, including
`bt_obex_add_header_app_param`, `bt_obex_add_header_auth_challenge`,
and `bt_obex_add_header_auth_rsp`.
Add a function `bt_obex_tlv_parse` to parse the encoded TLV-triplets.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
There are types of string can be added by using OBEX adding header
function bt_obex_add_header_*(). One is byte sequence. Another is null
terminated Unicode text.
Add a function bt_obex_string_is_valid() to check if the added string
is valid. And add a function bt_obex_unicode_is_valid() dedicated to
check Unicode string.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add commands for GOEP to test OBEX features.
Add command `alloc-buf` and `release-buf` to allocate and release TX
buffer.
Add command set `add-header` to add the OBEX headers to allocated TX
buffer.
Add command set `client` to send OBEX client requests with allocated
TX buffer.
Add command set `server` to send OBEX responses with allocated TX
buffer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add commands for GOEP to test transport features.
Add commands for transport over RFCOMM, including `register-rfcomm`,
`connect-rfcomm`, and `disconnect-rfcomm`.
Add commands for transport over L2CAP, including `register-l2cap`,
`connect-l2cap`, and `disconnect-l2cap`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The MTU of the GOEP should be not less than 255. So, if the transport
is RFCOMM, the CONFIG_BT_BUF_ACL_RX_SIZE should be not less than 264.
It includes,
- 255 bytes for the minimum MTU of GOEP,
- 4 bytes for L2CAP Header,
- 5 bytes for RFCOMM header and FCS.
And if the transport is L2CAP, the CONFIG_BT_BUF_ACL_RX_SIZE should
be not less than 259.
It includes,
- 255 bytes for the minimum MTU of GOEP,
- 4 bytes for L2CAP Header.
Add Kconfig `BT_GOEP_RFCOMM_MTU` to configure the maximum size for
RFCOMM transport. The range of `BT_GOEP_RFCOMM_MTU` is
`[264, BT_RFCOMM_L2CAP_MTU]`. And the GOEP MTU via RFCOMM transport
should be in the range `[255, (BT_GOEP_RFCOMM_MTU-9)]`.
Add Kconfig `BT_GOEP_L2CAP_MTU` to configure the maximum size for
L2CAP transport. The range of `BT_GOEP_L2CAP_MTU` is
`[259, BT_BUF_ACL_RX_SIZE]`. And the GOEP MTU via L2CAP transport
should be in the range `[255, (BT_GOEP_L2CAP_MTU-4)]`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a Kconfig BT_GOEP to control the GOEP feature.
Implement the GOEP protocol and transport, both for GOEP 1.1 and GOEP
2.x.
For GOEP transport, OBEX over RFCOMM, and OBEX over L2CAP are
supported.
For GOEP protocol, `put`, `get`, `abort`, `setpath`, and `action` are
supported. And only one operation can be processed at the same time.
The feature `Reliable Session` is unsupported.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
L2CAP channels will now, along with the ident, store the opcode of the
pending request. This commit expands the ident lookup function to also
compare received response types to this opcode, and will ignore
unsolicited responses.
Setting of idents for channels are moved after verification of buffer
allocation for the request to be sent. A TODO is added for improving
this functionality at a later time.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
These are helpful for logging in data-path, not to overwhelm the
console but still keep the user informed about the issues.
This is similar to printk_ratelimited in Linux kernel.
Add only basic build tests for now.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This functionality is implemented in the HCI-facing side of the
controller and the ULL. LLL functionality is not implemented in this
commit.
Furthermore, this removes a dependency for LE Power Control, as the
features are related, but not necessarily required.
Signed-off-by: Tyler Joseph Huffman <tyhu@demant.com>
Fix multiple warnings detected by clang:
* implicit conversions back and forth from enumeration type
'enum ocpp_notify_reason' to 'enum ocpp_pdu_msg'
in ocpp_internal_handler()
* label followed by a declarations
* variable declared after one switch case and used in another
* mapping a int to uint and later using it in < 0 comparisons
and with negative values
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The original implementation select the port
as best_port when stepsRemoved is equal to
the one of best_vector.
When challenger is from announce message
set in GPTP_PA_INFO_SUPERIOR_MASTER_PORT,
its stepsRemoved is the same as in the message.
When challenger is from master_priority
copied in GPTP_PA_INFO_UPDATE,
its stepsRemoved is [stepsRemoved of bestVector]+1.
Thus, we should add one to the challenger's
stepsRemoved in comparsion to avoid useless
update of bestVector.
Signed-off-by: Yusuke Omae <s1413091@gmail.com>
More complex suspend and resume scheme might require exactly defined
location of this variable due to platform peculiar SW and HW requirement.
DTS zephyr,memory-region node with nodelabel `pm_s2ram` shall be used to
automatic definition of linker section for such objective.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
When fs_stat() queries the root / mountpoint it should return its root
i_node but instead it tries to return the parent i_node which does not
exist. Fix this by checking if parent is set otherwise return the root
i_node.
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/94000.
Signed-off-by: Bas van Loon <bas@arch-embedded.com>
Basic support for open charge point protocol v1.6 as native stack with
below functionality
1. Framework for ocpp stack and central system communication using RPC over
websocket according to occp-j.
2. Core profile with basic PDU
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Co-authored-by: Sanjay Vallimanalan <sanjay@linumiz.com>
AICS gain mode does not prevent local nor remote operations from changing
the gain setting value. The gain setting value shall simply be ignored if
in the BT_AICS_MODE_AUTO_ONLY or BT_AICS_MODE_AUTO modes, but the local
application and remote devices can still modify the gain setting value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit adds support for the frame space update feature
to the bluetooth host.
This is mainly just a wrapper around the frame space update
HCI command and event.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Fix BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE define, as this was
not working correctly without brackets around
CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE.
Also fix CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE help,
as this was talking about remote featues, where this only
applies for local features.
Also update for new CONFIG_BT_CONN_DYNAMIC_CALLBACKS kconfig
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Providing a wrong address to the connect() call by the application is no
reason to assert, connect() should just return an error in such case.
Therefore remove the faulty assert and replace it with error log
instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The rest of the network (and generally Zephyr subsystem code) use the k_
prefixed variants for memory allocation, which results in data goin in
the _system_heap rather than the stdlib z_malloc_heap.
The code in getaddrinfo use the z_ ones as well apart from the actual
getaddrinfo implementation, which seems like an oversight, change it to
use k_calloc and k_free as well.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add initial support for the Cortex-M52 Core which is an implementation
of the Armv8.1-M mainline architecture.
The support is based on the Cortex-M55 support that already exists in
Zephyr.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
The write_ct function calls bt_cts_send_notification and if
bt_cts_send_notification fails to send a notification (e.g.
if there are no clients subscribed), it would return an
error, and thus send a ATT error response to the client,
even if the value was actually written.
This commit changes the behavior so that the notification
does not affect the return value (as it is not directly
linked to the write itself), but rather just logs it if
it fails to send the notification.
The notification can failed to be send for 2 main reasons:
1) The application returns an error on fill_current_cts_time
2) bt_gatt_notify fails to notify due to missing buffers
The first we cannot do much about. For the latter we can
either just live with the missing notification, or implement
a retry if we run out of buffers. For this simple fix the
former was chosen, but can be revisited if it turns out
to be a significant problem.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Since the SDUs are now allocated by the application
and the host does not care about the SDU sizes, the check
is useless.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit allows to the user to control the use or not of dynamic
connection callbacks.
The stack is not using the dynamic connection callbacks so they are
only needed if the applications want to use it.
Setting it to true for backwards compatibility.
With dynamic connection callbacks
FLASH: 176600 B 512 KB 33.68%
RAM: 27428 B 64 KB 41.85%
IDT_LIST: 0 GB 32 KB 0.00%
Without dynamic connection callbacks
FLASH: 176376 B 512 KB 33.64%
RAM: 27428 B 64 KB 41.85%
IDT_LIST: 0 GB 32 KB 0.00%
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
This commit registers the connection callbacks using BT_CONN_CB_DEFINE,
which ensures they are set up at link time rather than runtime.
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
This commit registers the connection callbacks using BT_CONN_CB_DEFINE,
which ensures they are set up at link time rather than runtime.
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
Fix the build error when hostapd enterprise is enabled, it should use
new wifi_set_enterprise_credentials API, instead of
wifi_set_enterprise_creds.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
This change addresses an alignment problem reported by UBSAN by
using a copy of the address. This avoids the need for extensive
rework to support *_raw variants in the routing layer.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
LwM2M engine does not allow strings to be truncated as it would
lead to invalind UTF-8 strings.
However, some content formatters were truncating, so I fixed at least
these
* plain text
* TLV
* SenML CBOR
* SenML JSON
* JSON
* CBOR
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
We should not block erasing pending images when using ramload with
revert mode, because uploading multiple confirmed images with the same
version would brick the device (preventing future FW updates). Update
the dependencies of img_mgmt_slot_in_use to account for this.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
boot_fetch_active_slot needs to map the slot number to a flash ID, as
this is what the DFU subsystem expects when interacting with the flash
partition.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Much like in RAMLOAD mode, RAMLOAD_WITH_REVERT requires that mcuboot
subsystem fetch bootloader information via the retention subsystem.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Fix default value of BT_TICKER_REMAINDER_GET, it will be
selected based on enabled Controller features. This is not
needed by minimal peripheral role.
Fix depends on for BT_CTLR_CONN_RANDOM_FORCE as it is
applicable when more than one simultaneous connections is
supported. Again, this is not needed by minimal peripheral
role.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>