@@ -7,19 +7,32 @@ index e1948cc..8d20bcd 100644
77 add_subdirectory_ifdef(CONFIG_APP_CLOUD src/modules/cloud)
88 add_subdirectory_ifdef(CONFIG_APP_FOTA src/modules/fota)
99+ add_subdirectory_ifdef(CONFIG_APP_DUMMY src/modules/dummy)
10+ diff --git a/app/Kconfig b/app/Kconfig
11+ index dad4070..684fe73 100644
12+ --- a/app/Kconfig
13+ +++ b/app/Kconfig
14+ @@ -15,6 +15,7 @@ rsource "src/modules/led/Kconfig.led"
15+ rsource "src/modules/fota/Kconfig.fota"
16+ rsource "src/modules/environmental/Kconfig.environmental"
17+ rsource "src/modules/button/Kconfig.button"
18+ + rsource "src/modules/dummy/Kconfig.dummy"
19+
20+ endmenu
21+
1022diff --git a/app/src/modules/dummy/CMakeLists.txt b/app/src/modules/dummy/CMakeLists.txt
1123new file mode 100644
12- index 0000000..a299b3b
24+ index 0000000..8b69448
1325--- /dev/null
1426+++ b/app/src/modules/dummy/CMakeLists.txt
15- @@ -0,0 +1,8 @@
27+ @@ -0,0 +1,9 @@
1628+ #
1729+ # Copyright (c) 2025 Nordic Semiconductor ASA
1830+ #
1931+ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
2032+ #
2133+
2234+ target_sources_ifdef(CONFIG_APP_DUMMY app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/dummy.c)
35+ + target_sources_ifdef(CONFIG_APP_DUMMY app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/dummy_shell.c)
2336+ target_include_directories(app PRIVATE .)
2437diff --git a/app/src/modules/dummy/Kconfig.dummy b/app/src/modules/dummy/Kconfig.dummy
2538new file mode 100644
@@ -66,7 +79,7 @@ index 0000000..2319814
6679+ endif # APP_DUMMY
6780diff --git a/app/src/modules/dummy/dummy.c b/app/src/modules/dummy/dummy.c
6881new file mode 100644
69- index 0000000..8c2450a
82+ index 0000000..c2733b5
7083--- /dev/null
7184+++ b/app/src/modules/dummy/dummy.c
7285@@ -0,0 +1,162 @@
@@ -149,7 +162,7 @@ index 0000000..8c2450a
149162+ /* State machine handlers */
150163+ static void state_running_run(void *o)
151164+ {
152- + const struct dummy_state *state_object = (const struct dummy_state *)o;
165+ + struct dummy_state *state_object = (struct dummy_state *)o;
153166+
154167+ if (&DUMMY_CHAN == state_object->chan) {
155168+ struct dummy_msg msg = MSG_TO_DUMMY_MSG(state_object->msg_buf);
@@ -279,3 +292,69 @@ index 0000000..4d3816e
279292+ #endif
280293+
281294+ #endif /* _DUMMY_H_ */
295+ diff --git a/app/src/modules/dummy/dummy_shell.c b/app/src/modules/dummy/dummy_shell.c
296+ new file mode 100644
297+ index 0000000..9a82441
298+ --- /dev/null
299+ +++ b/app/src/modules/dummy/dummy_shell.c
300+ @@ -0,0 +1,60 @@
301+ + /*
302+ + * Copyright (c) 2025 Nordic Semiconductor ASA
303+ + *
304+ + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
305+ + */
306+ +
307+ + #include <zephyr/kernel.h>
308+ + #include <zephyr/shell/shell.h>
309+ + #include <zephyr/zbus/zbus.h>
310+ + #include <zephyr/logging/log.h>
311+ +
312+ + #include "dummy.h"
313+ +
314+ + /* Register log module */
315+ + LOG_MODULE_REGISTER(dummy_shell_module, CONFIG_APP_DUMMY_LOG_LEVEL);
316+ +
317+ + /* Forward declarations */
318+ + static void dummy_shell_callback(const struct zbus_channel *chan);
319+ +
320+ + /* Register zbus callback */
321+ + ZBUS_LISTENER_DEFINE(dummy_shell, dummy_shell_callback);
322+ +
323+ + /* Add subscriber to channel */
324+ + ZBUS_CHAN_ADD_OBS(DUMMY_CHAN, dummy_shell, 0);
325+ +
326+ + /* Static variable to store shell reference */
327+ + static const struct shell *dummy_shell_ref;
328+ +
329+ + /* Shell command handler for sending dummy request */
330+ + static int cmd_dummy_request(const struct shell *shell, size_t argc, char **argv)
331+ + {
332+ + struct dummy_msg request = {
333+ + .type = DUMMY_SAMPLE_REQUEST,
334+ + };
335+ +
336+ + /* Store the shell reference */
337+ + dummy_shell_ref = shell;
338+ +
339+ + int err = zbus_chan_pub(&DUMMY_CHAN, &request, K_SECONDS(1));
340+ + if (err) {
341+ + shell_error(shell, "Failed to send request: %d", err);
342+ + return err;
343+ + }
344+ +
345+ + shell_print(shell, "Dummy request sent");
346+ + return 0;
347+ + }
348+ +
349+ + /* Shell command handler for receiving dummy response */
350+ + static void dummy_shell_callback(const struct zbus_channel *chan)
351+ + {
352+ + const struct dummy_msg *response = zbus_chan_const_msg(chan);
353+ +
354+ + if (response->type == DUMMY_SAMPLE_RESPONSE) {
355+ + shell_print(dummy_shell_ref, "Response received: %d", response->value);
356+ + }
357+ + }
358+ +
359+ + /* Register shell command */
360+ + SHELL_CMD_REGISTER(att_dummy_request, NULL, "Asset Tracker Template Dummy CMDs", cmd_dummy_request);
0 commit comments