Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
816 changes: 28 additions & 788 deletions addons/BSD/nxd_bsd.c

Large diffs are not rendered by default.

32 changes: 6 additions & 26 deletions addons/BSD/nxd_bsd.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -36,29 +36,6 @@
/* implement the BSD 4.3 Socket API Compatible Interface to NetX Duo. */
/* */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 03-02-2021 Yuxin Zhou Modified comment(s), and */
/* fixed compiler warnings, */
/* resulting in version 6.1.5 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), and */
/* defined IP protocols for */
/* ICMP, IGMP and ICMPv6, */
/* resulting in version 6.1.9 */
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), and */
/* added option to enable */
/* native APIs with prefix, */
/* resulting in version 6.3.0 */
/* 12-31-2023 Yanwu Cai Modified comment(s), and */
/* added support of recvmsg, */
/* added nx_link to raw socket,*/
/* resulting in version 6.4.0 */
/* */
/**************************************************************************/

#ifndef NXD_BSD_H
Expand Down Expand Up @@ -708,6 +685,9 @@ typedef struct FD_SET_STRUCT /* The select socket array manager.
typedef struct NX_BSD_SOCKET_SUSPEND_STRUCT
{
ULONG nx_bsd_socket_suspend_actual_flags;
nx_bsd_fd_set nx_bsd_socket_suspend_read_request_fd_set;
nx_bsd_fd_set nx_bsd_socket_suspend_write_request_fd_set;
nx_bsd_fd_set nx_bsd_socket_suspend_exception_request_fd_set;
nx_bsd_fd_set nx_bsd_socket_suspend_read_fd_set;
nx_bsd_fd_set nx_bsd_socket_suspend_write_fd_set;
nx_bsd_fd_set nx_bsd_socket_suspend_exception_fd_set;
Expand Down
133 changes: 9 additions & 124 deletions addons/auto_ip/nx_auto_ip.c

Large diffs are not rendered by default.

23 changes: 6 additions & 17 deletions addons/auto_ip/nx_auto_ip.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -37,17 +37,6 @@
/* including all data types and external references. It is assumed */
/* that nx_api.h and nx_port.h have already been included. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
/* resulting in version 6.1 */
/* 10-15-2021 Yuxin Zhou Modified comment(s), included */
/* necessary header file, */
/* resulting in version 6.1.9 */
/* */
/**************************************************************************/

#ifndef NX_AUTO_IP_H
Expand Down Expand Up @@ -127,7 +116,7 @@ extern "C" {
#define NX_AUTO_IP_BAD_INTERFACE_INDEX 0xA02


/* Define the AutoIP structure that holds all the information necessary for this AutoIP
/* Define the AutoIP structure that holds all the information necessary for this AutoIP
instance. */

typedef struct NX_AUTO_IP_STRUCT
Expand All @@ -151,9 +140,9 @@ typedef struct NX_AUTO_IP_STRUCT

/* Application caller is present, perform API mapping. */

/* Determine if error checking is desired. If so, map AutoIP API functions
/* Determine if error checking is desired. If so, map AutoIP API functions
to the appropriate error checking front-ends. Otherwise, map API
functions to the core functions that actually perform the work.
functions to the core functions that actually perform the work.
Note: error checking is enabled by default. */

#ifdef NX_DISABLE_ERROR_CHECKING
Expand Down
6 changes: 3 additions & 3 deletions addons/azure_iot/nx_azure_iot.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down
10 changes: 5 additions & 5 deletions addons/azure_iot/nx_azure_iot.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -69,7 +69,7 @@ extern "C" {
* message, at-most one format specifier can be specifed at the end of message.
* Currently only two format specifier are supported:
* - %d for integer
* - %s for string, where first argument is length and second is pointer to string
* - %s for string, where first argument is length and second is pointer to string
*/
UINT nx_azure_iot_log(UCHAR *type_ptr, UINT type_len, UCHAR *msg_ptr, UINT msg_len, ...);

Expand Down Expand Up @@ -231,7 +231,7 @@ typedef struct NX_AZURE_IOT_THREAD_STRUCT
* manage activities related to Azure IoT services. Only one NX_AZURE_IOT instance
* is needed to manage instances for Azure IoT hub, IoT Central, and Device Provisioning
* Services (DPS).
*
*
* @param[in] nx_azure_iot_ptr A pointer to a #NX_AZURE_IOT
* @param[in] name_ptr A pointer to a NULL-terminated string indicating the name of the Azure IoT instance.
* @param[in] ip_ptr A pointer to a `NX_IP`, which is the IP stack used to connect to Azure IoT Services.
Expand Down
14 changes: 7 additions & 7 deletions addons/azure_iot/nx_azure_iot_adu_agent.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -1199,7 +1199,7 @@ UCHAR *sha256_decoded_hash_64_ptr;
UCHAR *sha256_decoded_hash_ptr;

/* The updateManifestSignature is used to ensure that the information contained within the updateManifest
hasn't been tampered with.
hasn't been tampered with.
https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-security#json-web-signature-jws */

/* JWS value format: BASE64URL(UTF8(header)) + "." + BASE64URL(UTF8(payload) + "." + BASE64URL(signature)). */
Expand Down Expand Up @@ -1322,7 +1322,7 @@ UCHAR *sha256_decoded_hash_ptr;
"alg": "RS256",
"kid": "ADU.200702.R"
}

Payload:
{
"kty": "RSA",
Expand Down Expand Up @@ -2368,7 +2368,7 @@ NX_AZURE_IOT_ADU_AGENT_WORKFLOW *workflow = &(adu_agent_ptr -> nx_azure_iot_adu_
}
}

/* File URLs.
/* File URLs.
Note: 1. file urls property can exist or not.
2. file urls property value can be object. */
else if (nx_azure_iot_json_reader_token_is_text_equal(json_reader_ptr,
Expand Down Expand Up @@ -3619,7 +3619,7 @@ UINT update_id_length;

/**
* @brief Send service reported properties.
*
*
* @param updateState state to report.
* @param result Result to report (optional, can be NULL).
*/
Expand Down
10 changes: 5 additions & 5 deletions addons/azure_iot/nx_azure_iot_adu_agent.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -119,13 +119,13 @@ extern "C" {
#define NX_AZURE_IOT_ADU_AGENT_HTTP_CONNECT_DONE_EVENT ((ULONG)0x00000010)
#define NX_AZURE_IOT_ADU_AGENT_HTTP_RECEIVE_EVENT ((ULONG)0x00000020)

/* Define the agent state values. Interaction between agent and server.
/* Define the agent state values. Interaction between agent and server.
https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-plug-and-play#state */
#define NX_AZURE_IOT_ADU_AGENT_STATE_IDLE 0
#define NX_AZURE_IOT_ADU_AGENT_STATE_DEPLOYMENT_IN_PROGRESS 6
#define NX_AZURE_IOT_ADU_AGENT_STATE_FAILED 255

/* Define the agent action values. Interaction between agent and server.
/* Define the agent action values. Interaction between agent and server.
https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-plug-and-play#action */
#define NX_AZURE_IOT_ADU_AGENT_ACTION_APPLY_DEPLOYMENT 3
#define NX_AZURE_IOT_ADU_AGENT_ACTION_CANCEL 255
Expand Down
12 changes: 6 additions & 6 deletions addons/azure_iot/nx_azure_iot_adu_root_key.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

#include "nx_azure_iot_adu_agent.h"

/* Update manifest is meant for ADU devices to know what files are needed to be downloaded and installed.
The update manifest is signed by ADU so devices can trust that the content wasnot altered during the
The update manifest is signed by ADU so devices can trust that the content wasnot altered during the
transmission.

ADU will leverage two types of keys - Root Key(s) and Signing Key(s). Signing keys will be used to
ADU will leverage two types of keys - Root Key(s) and Signing Key(s). Signing keys will be used to
digest sign the update manifest and root keys will be used to sign the signing keys.

*Root key - used to sign signing public key; root public key is hardcoded in ADU devices.
*Signing key - used to sign update manifest; signing public key signed with the master key is included in digest signature header.
*/
Expand Down
6 changes: 3 additions & 3 deletions addons/azure_iot/nx_azure_iot_hub_client.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down
6 changes: 3 additions & 3 deletions addons/azure_iot/nx_azure_iot_hub_client.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down
6 changes: 3 additions & 3 deletions addons/azure_iot/nx_azure_iot_hub_client_properties.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down
16 changes: 8 additions & 8 deletions addons/azure_iot/nx_azure_iot_hub_client_properties.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down Expand Up @@ -189,7 +189,7 @@ UINT nx_azure_iot_hub_client_properties_version_get(NX_AZURE_IOT_HUB_CLIENT *hub

/**
* @brief Iteratively read the Azure IoT Plug and Play component properties.
*
*
* Note that between calls, the UCHAR* pointed to by \p component_name_pptr shall not be modified,
* only checked and compared. Internally, the pointer is only changed if the component name changes
* in the JSON document and is not necessarily set every invocation of the function.
Expand All @@ -211,14 +211,14 @@ UINT nx_azure_iot_hub_client_properties_version_get(NX_AZURE_IOT_HUB_CLIENT *hub
* NX_AZURE_IOT_HUB_CLIENT_PROPERTY_WRITABLE,
* &component_name_ptr, &component_length)) == NX_AZURE_IOT_SUCCESS)
* {
*
*
* // Check if property is of interest (substitute user_property for your own property name)
* if (nx_azure_iot_json_reader_token_is_text_equal(&json_reader, user_property, user_property_length))
* {
* nx_azure_iot_json_reader_next_token(&json_reader);
*
* // Get the property value here
* // Example: nx_azure_iot_json_reader_token_int32_get(&json_reader, &user_int);
* // Example: nx_azure_iot_json_reader_token_int32_get(&json_reader, &user_int);
*
* // Skip to next property value
* nx_azure_iot_json_reader_next_token(&json_reader);
Expand All @@ -236,13 +236,13 @@ UINT nx_azure_iot_hub_client_properties_version_get(NX_AZURE_IOT_HUB_CLIENT *hub
* }
*
* @endcode
*
*
* @warning If you need to retrieve more than one \p property_type, you should first complete the
* scan of all components for the first property type (until the API returns
* NX_AZURE_IOT_NOT_FOUND). Then you must call nx_azure_iot_json_reader_init() again after this call
* and before the next call to `nx_azure_iot_hub_client_properties_component_property_next_get` with the
* different \p property_type.
*
*
* @param[in] hub_client_ptr A pointer to a #NX_AZURE_IOT_HUB_CLIENT.
* @param[in] reader_ptr A pointer to a #NX_AZURE_IOT_JSON_READER containing properties document
* @param[in] message_type Type of message repsonse, only valid value are NX_AZURE_IOT_HUB_PROPERTIES or NX_AZURE_IOT_HUB_WRITABLE_PROPERTIES
Expand Down
6 changes: 3 additions & 3 deletions addons/azure_iot/nx_azure_iot_json_reader.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand Down
Loading
Loading