diff --git a/app/src/main.c b/app/src/main.c index 2563ceb6..f32855e0 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -14,7 +14,7 @@ #include "app_common.h" #include "button.h" #include "network.h" -#include "cloud_module.h" +#include "cloud.h" #include "fota.h" #include "location.h" #include "cbor_helper.h" diff --git a/app/src/modules/cloud/CMakeLists.txt b/app/src/modules/cloud/CMakeLists.txt index 975ac231..108eff18 100644 --- a/app/src/modules/cloud/CMakeLists.txt +++ b/app/src/modules/cloud/CMakeLists.txt @@ -4,8 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cloud_module.c) -target_sources_ifdef(CONFIG_APP_CLOUD_SHELL app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cloud_module_shell.c) +target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cloud.c) +target_sources_ifdef(CONFIG_APP_CLOUD_SHELL app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cloud_shell.c) target_include_directories(app PRIVATE .) if (CONFIG_NRF_CLOUD_COAP_SEC_TAG GREATER_EQUAL 2147483648 AND CONFIG_NRF_CLOUD_COAP_SEC_TAG LESS_EQUAL 2147483667) diff --git a/app/src/modules/cloud/cloud_module.c b/app/src/modules/cloud/cloud.c similarity index 99% rename from app/src/modules/cloud/cloud_module.c rename to app/src/modules/cloud/cloud.c index 96969142..1346a494 100644 --- a/app/src/modules/cloud/cloud_module.c +++ b/app/src/modules/cloud/cloud.c @@ -21,7 +21,7 @@ #include #endif /* CONFIG_MEMFAULT */ -#include "cloud_module.h" +#include "cloud.h" #include "app_common.h" #include "network.h" @@ -735,7 +735,7 @@ static void state_connected_paused_run(void *o) /* End of state handlers */ -static void cloud_module_thread(void) +static void cloud_thread(void) { int err; int task_wdt_id; @@ -787,6 +787,6 @@ static void cloud_module_thread(void) } } -K_THREAD_DEFINE(cloud_module_thread_id, +K_THREAD_DEFINE(cloud_thread_id, CONFIG_APP_CLOUD_THREAD_STACK_SIZE, - cloud_module_thread, NULL, NULL, NULL, K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0); + cloud_thread, NULL, NULL, NULL, K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0); diff --git a/app/src/modules/cloud/cloud_module.h b/app/src/modules/cloud/cloud.h similarity index 93% rename from app/src/modules/cloud/cloud_module.h rename to app/src/modules/cloud/cloud.h index ac3a4a70..4a9ec7a3 100644 --- a/app/src/modules/cloud/cloud_module.h +++ b/app/src/modules/cloud/cloud.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#ifndef _CLOUD_MODULE_H_ -#define _CLOUD_MODULE_H_ +#ifndef _CLOUD_H_ +#define _CLOUD_H_ #include #include @@ -55,4 +55,4 @@ struct cloud_msg { } #endif -#endif /* _CLOUD_MODULE_H_ */ +#endif /* _CLOUD_H_ */ diff --git a/app/src/modules/cloud/cloud_module_shell.c b/app/src/modules/cloud/cloud_shell.c similarity index 98% rename from app/src/modules/cloud/cloud_module_shell.c rename to app/src/modules/cloud/cloud_shell.c index eae7ca09..c229e5ce 100644 --- a/app/src/modules/cloud/cloud_module_shell.c +++ b/app/src/modules/cloud/cloud_shell.c @@ -11,7 +11,7 @@ #include #include -#include "cloud_module.h" +#include "cloud.h" LOG_MODULE_DECLARE(cloud, CONFIG_APP_CLOUD_LOG_LEVEL); diff --git a/docs/common/tooling_troubleshooting.md b/docs/common/tooling_troubleshooting.md index 4d72c742..cad27061 100644 --- a/docs/common/tooling_troubleshooting.md +++ b/docs/common/tooling_troubleshooting.md @@ -201,7 +201,7 @@ The listed configurations configure the thread analyzer to print thread informat [00:00:30.726,593] thread_analyzer: : Total CPU cycles used: 37 [00:00:30.726,715] thread_analyzer: coap_client_recv_thread: STACK: unused 592 usage 688 / 1280 (53 %); CPU: 0 % [00:00:30.726,745] thread_analyzer: : Total CPU cycles used: 273 -[00:00:30.726,867] thread_analyzer: cloud_module_thread_id: STACK: unused 328 usage 3000 / 3328 (90 %); CPU: 0 % +[00:00:30.726,867] thread_analyzer: cloud_thread_id: STACK: unused 328 usage 3000 / 3328 (90 %); CPU: 0 % [00:00:30.726,898] thread_analyzer: : Total CPU cycles used: 1081 [00:00:30.726,959] thread_analyzer: date_time_work_q : STACK: unused 80 usage 368 / 448 (82 %); CPU: 0 % [00:00:30.726,989] thread_analyzer: : Total CPU cycles used: 11 diff --git a/docs/modules/cloud.md b/docs/modules/cloud.md index 42531460..944d22b3 100644 --- a/docs/modules/cloud.md +++ b/docs/modules/cloud.md @@ -12,11 +12,11 @@ The module's responsibilities include: nRF Cloud over CoAP utilizes DTLS connection ID which allows the device to quickly re-establish a secure connection with the cloud after a network disconnection without the need for a full DTLS handshake. The module uses the nRF Cloud CoAP library to handle the CoAP communication and DTLS connection management. -Below, the module’s main messages, configurations, and state machine are covered. Refer to the source files (`cloud_module.c`, `cloud_module.h`, and `Kconfig.cloud`) for implementation details. +Below, the module’s main messages, configurations, and state machine are covered. Refer to the source files (`cloud.c`, `cloud.h`, and `Kconfig.cloud`) for implementation details. ## Messages -The cloud module publishes and receives messages over the zbus channel `CLOUD_CHAN`. All module message types are defined in `cloud_module.h` and used within `cloud_module.c`. +The cloud module publishes and receives messages over the zbus channel `CLOUD_CHAN`. All module message types are defined in `cloud.h` and used within `cloud.c`. ### Input Messages @@ -37,7 +37,7 @@ The cloud module publishes and receives messages over the zbus channel `CLOUD_CH - **CLOUD_SHADOW_RESPONSE** Returns shadow data or a shadow delta received from nRF Cloud. -The message structure used by the cloud module is defined in `cloud_module.h`: +The message structure used by the cloud module is defined in `cloud.h`: ```c struct cloud_msg { @@ -101,7 +101,7 @@ For more details on these and other configurations, refer to `Kconfig.cloud`. ## State diagram -Below is a simplified representation of the state machine implemented in `cloud_module.c`. The module starts in the **STATE_RUNNING** context, which immediately transitions to **STATE_DISCONNECTED** upon initialization. From there, network events and internal conditions drive state transitions. +Below is a simplified representation of the state machine implemented in `cloud.c`. The module starts in the **STATE_RUNNING** context, which immediately transitions to **STATE_DISCONNECTED** upon initialization. From there, network events and internal conditions drive state transitions. ```mermaid stateDiagram-v2 diff --git a/docs/patches/magnetometer.patch b/docs/patches/magnetometer.patch index 421752e2..7055d5c3 100644 --- a/docs/patches/magnetometer.patch +++ b/docs/patches/magnetometer.patch @@ -13,10 +13,10 @@ index e68d98b..1901eca 100644 / { chosen { zephyr,wifi = &nordic_wlan0; -diff --git a/app/src/modules/cloud/cloud_module.c b/app/src/modules/cloud/cloud_module.c +diff --git a/app/src/modules/cloud/cloud.c b/app/src/modules/cloud/cloud.c index 9696914..a701140 100644 ---- a/app/src/modules/cloud/cloud_module.c -+++ b/app/src/modules/cloud/cloud_module.c +--- a/app/src/modules/cloud/cloud.c ++++ b/app/src/modules/cloud/cloud.c @@ -38,6 +38,7 @@ LOG_MODULE_REGISTER(cloud, CONFIG_APP_CLOUD_LOG_LEVEL); #define CUSTOM_JSON_APPID_VAL_CONEVAL "CONEVAL" diff --git a/tests/module/cloud/CMakeLists.txt b/tests/module/cloud/CMakeLists.txt index 7e550c7e..f004e66e 100644 --- a/tests/module/cloud/CMakeLists.txt +++ b/tests/module/cloud/CMakeLists.txt @@ -14,7 +14,7 @@ test_runner_generate(src/cloud_module_test.c) target_sources(app PRIVATE src/cloud_module_test.c - ../../../app/src/modules/cloud/cloud_module.c + ../../../app/src/modules/cloud/cloud.c ) zephyr_include_directories(${ZEPHYR_BASE}/include/zephyr/) diff --git a/tests/module/cloud/src/cloud_module_test.c b/tests/module/cloud/src/cloud_module_test.c index cac63456..5e8c6a57 100644 --- a/tests/module/cloud/src/cloud_module_test.c +++ b/tests/module/cloud/src/cloud_module_test.c @@ -17,7 +17,7 @@ #include #include "environmental.h" -#include "cloud_module.h" +#include "cloud.h" #include "power.h" #include "network.h" #include "app_common.h" diff --git a/tests/module/main/src/main.c b/tests/module/main/src/main.c index 3d26aed5..b0457dee 100644 --- a/tests/module/main/src/main.c +++ b/tests/module/main/src/main.c @@ -15,7 +15,7 @@ #include "power.h" #include "network.h" #include "environmental.h" -#include "cloud_module.h" +#include "cloud.h" #include "fota.h" #include "location.h" #include "led.h"