From 64dc2381a0ca997a148d102dee955cf08eeb489b Mon Sep 17 00:00:00 2001 From: Aaron Chan Date: Sat, 2 May 2026 10:11:13 -0400 Subject: [PATCH 1/3] receiver 433 config and fix native sim compile --- app/backplane/radio_module/core.conf | 3 --- app/ground/receiver_module/boards/native_sim.overlay | 10 +++++++++- app/ground/receiver_module/core.conf | 3 --- app/ground/receiver_module/include/c_receiver_module.h | 4 ++++ app/ground/receiver_module/sample.yaml | 7 +++++++ app/ground/receiver_module/src/c_receiver_module.cpp | 8 +++++++- app/ground/receiver_module/src/main.cpp | 7 ++++++- .../frame_handlers/c_frequency_change_handler.cpp | 2 +- .../frame_handlers/c_lora_freq_request_tenant.cpp | 2 +- snippets/sim-periph/sim-periph.conf | 7 ++++++- 10 files changed, 41 insertions(+), 12 deletions(-) diff --git a/app/backplane/radio_module/core.conf b/app/backplane/radio_module/core.conf index 397525b6b..d9688b91b 100644 --- a/app/backplane/radio_module/core.conf +++ b/app/backplane/radio_module/core.conf @@ -58,6 +58,3 @@ CONFIG_GNSS=y CONFIG_GNSS_SATELLITES=y CONFIG_GNSS_NMEA0183=y CONFIG_UART_INTERRUPT_DRIVEN=y - -# Suppress LORA LOG to only errors -CONFIG_LORA_LOG_LEVEL_ERR=y diff --git a/app/ground/receiver_module/boards/native_sim.overlay b/app/ground/receiver_module/boards/native_sim.overlay index e7f1dbae4..54a403fde 100644 --- a/app/ground/receiver_module/boards/native_sim.overlay +++ b/app/ground/receiver_module/boards/native_sim.overlay @@ -28,6 +28,14 @@ // anyway }; }; + + gnss: gnss { + status = "okay"; + compatible = "openrocket,gnss"; + lag-time-us = <1000>; + sampling-period-us = <(5*1000*1000)>; + rtc = <&rtc>; + }; }; &rtc { @@ -77,4 +85,4 @@ }; }; }; -}; \ No newline at end of file +}; diff --git a/app/ground/receiver_module/core.conf b/app/ground/receiver_module/core.conf index 52e104014..0c5be08e7 100644 --- a/app/ground/receiver_module/core.conf +++ b/app/ground/receiver_module/core.conf @@ -58,6 +58,3 @@ CONFIG_SENSOR=n CONFIG_GNSS=n CONFIG_GNSS_SATELLITES=n CONFIG_GNSS_NMEA0183=n - -# Suppress LORA LOG to only errors -CONFIG_LORA_LOG_LEVEL_ERR=y \ No newline at end of file diff --git a/app/ground/receiver_module/include/c_receiver_module.h b/app/ground/receiver_module/include/c_receiver_module.h index feb0dacf1..328c46507 100644 --- a/app/ground/receiver_module/include/c_receiver_module.h +++ b/app/ground/receiver_module/include/c_receiver_module.h @@ -45,17 +45,21 @@ class CReceiverModule : public CProjectConfiguration { static constexpr uint16_t radioModuleFrequencyAckPort = NNetworkDefs::RADIO_MODULE_FREQUENCY_CHANGE_RESPONSE_PORT; // Devices +#ifndef CONFIG_ARCH_POSIX CLora lora; +#endif // Message Ports CMessagePort& loraBroadcastMessagePort; CMessagePort& udpBroadcastMessagePort; // Tenants +#ifndef CONFIG_ARCH_POSIX CLoraTenant loraTenant{lora, loraBroadcastMessagePort}; CLoraFreqRequestTenant freqRequestTenant{ipAddrStr.c_str(), lora, radioModuleFrequencyCommandPort, loraBroadcastMessagePort, K_SECONDS(15)}; +#endif CUdpListenerTenant commandListenerTenant{"Radio Module Command Listener Tenant", ipAddrStr.c_str(), radioModuleCommandPort, &loraBroadcastMessagePort}; diff --git a/app/ground/receiver_module/sample.yaml b/app/ground/receiver_module/sample.yaml index af343ca50..62b8a93e9 100644 --- a/app/ground/receiver_module/sample.yaml +++ b/app/ground/receiver_module/sample.yaml @@ -7,6 +7,13 @@ common: - radio_module tests: ground.receiever_module.default: {} + ground.receiver_module.433mhz: + extra_overlay_confs: + - 433mhz.conf ground.receiver_module.debug: extra_overlay_confs: - debug.conf + ground.receiver_module.debug_433mhz: + extra_overlay_confs: + - debug.conf + - 433mhz.conf diff --git a/app/ground/receiver_module/src/c_receiver_module.cpp b/app/ground/receiver_module/src/c_receiver_module.cpp index d6d995239..15a981f1f 100644 --- a/app/ground/receiver_module/src/c_receiver_module.cpp +++ b/app/ground/receiver_module/src/c_receiver_module.cpp @@ -11,7 +11,11 @@ static auto loraBroadcastMsgQueue = CMsgqMessagePort(broadcastQ static auto udpBroadcastMsgQueue = CMsgqMessagePort(broadcastQueue); CReceiverModule::CReceiverModule() - : CProjectConfiguration(), lora(*DEVICE_DT_GET(DT_ALIAS(lora))), loraBroadcastMessagePort(loraBroadcastMsgQueue), + : CProjectConfiguration(), +#ifndef CONFIG_ARCH_POSIX + lora(*DEVICE_DT_GET(DT_ALIAS(lora))), +#endif + loraBroadcastMessagePort(loraBroadcastMsgQueue), udpBroadcastMessagePort(udpBroadcastMsgQueue) {} void CReceiverModule::AddTenantsToTasks() { @@ -19,12 +23,14 @@ void CReceiverModule::AddTenantsToTasks() { networkingTask.AddTenant(commandListenerTenant); networkingTask.AddTenant(dataRequestListenerTenant); +#ifndef CONFIG_ARCH_POSIX // LoRa loraTenant.SetToGround(); loraTenant.RegisterFrameHandler(radioModuleFrequencyAckPort, freqRequestTenant); loraTenant.RegisterDefaultFrameHandler(loraToUdpHandler); loraTask.AddTenant(freqRequestTenant); loraTask.AddTenant(loraTenant); +#endif } void CReceiverModule::AddTasksToRtos() { diff --git a/app/ground/receiver_module/src/main.cpp b/app/ground/receiver_module/src/main.cpp index 0377ec0c7..2ff26f21e 100644 --- a/app/ground/receiver_module/src/main.cpp +++ b/app/ground/receiver_module/src/main.cpp @@ -14,7 +14,12 @@ LOG_MODULE_REGISTER(main); int main() { - LOG_INF("Receiver starting"); +#ifdef CONFIG_LICENSED_FREQUENCY + LOG_INF("Receiver boot: 433 MHz build"); +#else + LOG_INF("Receiver boot: 915 MHz build"); +#endif + static CReceiverModule receiverModule{}; receiverModule.AddTenantsToTasks(); receiverModule.AddTasksToRtos(); diff --git a/lib/f_core/radio/frame_handlers/c_frequency_change_handler.cpp b/lib/f_core/radio/frame_handlers/c_frequency_change_handler.cpp index 08c16652b..f53a393de 100644 --- a/lib/f_core/radio/frame_handlers/c_frequency_change_handler.cpp +++ b/lib/f_core/radio/frame_handlers/c_frequency_change_handler.cpp @@ -2,8 +2,8 @@ #include "zephyr/logging/log.h" -#include #include +#include LOG_MODULE_REGISTER(CFrequencyChangeHandler); diff --git a/lib/f_core/radio/frame_handlers/c_lora_freq_request_tenant.cpp b/lib/f_core/radio/frame_handlers/c_lora_freq_request_tenant.cpp index 9d70dc2b6..a848b2d1d 100644 --- a/lib/f_core/radio/frame_handlers/c_lora_freq_request_tenant.cpp +++ b/lib/f_core/radio/frame_handlers/c_lora_freq_request_tenant.cpp @@ -1,9 +1,9 @@ #include "f_core/radio/frame_handlers/c_lora_freq_request_tenant.h" -#include #include #include #include +#include LOG_MODULE_REGISTER(CLoraFreqRequestTenant); diff --git a/snippets/sim-periph/sim-periph.conf b/snippets/sim-periph/sim-periph.conf index d477cbc3d..7e2c3b87d 100644 --- a/snippets/sim-periph/sim-periph.conf +++ b/snippets/sim-periph/sim-periph.conf @@ -6,7 +6,12 @@ CONFIG_FUSE_LIBRARY_V3=y CONFIG_RTC_EMUL=y # Networking -CONFIG_ETH_NATIVE_POSIX=n CONFIG_NET_SOCKETS_OFFLOAD=y CONFIG_NET_NATIVE_OFFLOADED_SOCKETS=y CONFIG_HEAP_MEM_POOL_SIZE=1024 + +# Driver-specific shell helpers are enabled by the debug/complete-shell snippets, +# but native_sim app configs may intentionally disable the corresponding drivers. +CONFIG_GPIO_SHELL=n +CONFIG_I2C_SHELL=n +CONFIG_SENSOR_SHELL=n From 9d7c609d5b7a13b141a87c33f895684b13b811f9 Mon Sep 17 00:00:00 2001 From: Aaron Chan Date: Sat, 2 May 2026 11:23:22 -0400 Subject: [PATCH 2/3] Fill descs --- app/other/airbraker/sample.yaml | 2 +- app/payload/control_freak/board-setup/sample.yaml | 2 +- app/payload/control_freak/flight-software/sample.yaml | 2 +- app/payload/control_freak/ground_station2/sample.yaml | 2 +- app/payload/control_freak/imagine/sample.yaml | 2 +- app/payload/control_freak/radio_test/sample.yaml | 2 +- app/samples/compression/sample.yaml | 2 +- app/samples/datalogger/sample.yaml | 2 +- app/samples/gpio_blinky/sample.yaml | 2 +- app/samples/littlefs/sample.yaml | 2 +- app/samples/lora_bcast/sample.yaml | 2 +- app/samples/message_passing/sample.yaml | 2 +- app/samples/openrocket_sensors/sample.yaml | 2 +- app/samples/phase_detection/sample.yaml | 2 +- app/samples/sensor/sample.yaml | 2 +- app/samples/shield_blinky/sample.yaml | 2 +- app/samples/shield_mcp3561r/sample.yaml | 2 +- app/samples/sntp_client/sample.yaml | 2 +- app/samples/soft_timer/sample.yaml | 2 +- app/samples/tenants_and_tasks/sample.yaml | 2 +- app/samples/tftp_server/sample.yaml | 2 +- app/samples/time_travel/sample.yaml | 2 +- app/samples/udp_bcast/sample.yaml | 2 +- app/samples/udp_rcv/sample.yaml | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/other/airbraker/sample.yaml b/app/other/airbraker/sample.yaml index 677b09d2b..6a3f53b9f 100644 --- a/app/other/airbraker/sample.yaml +++ b/app/other/airbraker/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: airbrake_ctrler name: airbrake_ctrler common: build_only: true diff --git a/app/payload/control_freak/board-setup/sample.yaml b/app/payload/control_freak/board-setup/sample.yaml index 277a1dcff..ef5782581 100644 --- a/app/payload/control_freak/board-setup/sample.yaml +++ b/app/payload/control_freak/board-setup/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: control_freak bring up and debugging name: control_freak bring up and debugging common: build_only: true diff --git a/app/payload/control_freak/flight-software/sample.yaml b/app/payload/control_freak/flight-software/sample.yaml index f40e02dbd..80f39d1b4 100644 --- a/app/payload/control_freak/flight-software/sample.yaml +++ b/app/payload/control_freak/flight-software/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: Control Freak flight software name: control_freak common: build_only: true diff --git a/app/payload/control_freak/ground_station2/sample.yaml b/app/payload/control_freak/ground_station2/sample.yaml index f40e02dbd..fc0619683 100644 --- a/app/payload/control_freak/ground_station2/sample.yaml +++ b/app/payload/control_freak/ground_station2/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: control_freak name: control_freak common: build_only: true diff --git a/app/payload/control_freak/imagine/sample.yaml b/app/payload/control_freak/imagine/sample.yaml index 277a1dcff..ef5782581 100644 --- a/app/payload/control_freak/imagine/sample.yaml +++ b/app/payload/control_freak/imagine/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: control_freak bring up and debugging name: control_freak bring up and debugging common: build_only: true diff --git a/app/payload/control_freak/radio_test/sample.yaml b/app/payload/control_freak/radio_test/sample.yaml index 277a1dcff..ef5782581 100644 --- a/app/payload/control_freak/radio_test/sample.yaml +++ b/app/payload/control_freak/radio_test/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: control_freak bring up and debugging name: control_freak bring up and debugging common: build_only: true diff --git a/app/samples/compression/sample.yaml b/app/samples/compression/sample.yaml index d7b354c84..22284ec63 100644 --- a/app/samples/compression/sample.yaml +++ b/app/samples/compression/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: compression name: compression common: build_only: true diff --git a/app/samples/datalogger/sample.yaml b/app/samples/datalogger/sample.yaml index aa1c297f0..30f6c37a5 100644 --- a/app/samples/datalogger/sample.yaml +++ b/app/samples/datalogger/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: datalogger name: datalogger common: build_only: true diff --git a/app/samples/gpio_blinky/sample.yaml b/app/samples/gpio_blinky/sample.yaml index 5e2da7df6..9a6d7fc15 100644 --- a/app/samples/gpio_blinky/sample.yaml +++ b/app/samples/gpio_blinky/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: gpio-blinky name: gpio-blinky common: build_only: true diff --git a/app/samples/littlefs/sample.yaml b/app/samples/littlefs/sample.yaml index b5c1bbba6..b3767194a 100644 --- a/app/samples/littlefs/sample.yaml +++ b/app/samples/littlefs/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: littlefs name: littlefs common: build_only: true diff --git a/app/samples/lora_bcast/sample.yaml b/app/samples/lora_bcast/sample.yaml index 8ec058042..b9c58830e 100644 --- a/app/samples/lora_bcast/sample.yaml +++ b/app/samples/lora_bcast/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: lora-back-and-forth name: lora-back-and-forth common: build_only: true diff --git a/app/samples/message_passing/sample.yaml b/app/samples/message_passing/sample.yaml index 7918fc08e..3ba63f701 100644 --- a/app/samples/message_passing/sample.yaml +++ b/app/samples/message_passing/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: message-passing name: message-passing common: build_only: true diff --git a/app/samples/openrocket_sensors/sample.yaml b/app/samples/openrocket_sensors/sample.yaml index 7c5a990b4..40a5e8057 100644 --- a/app/samples/openrocket_sensors/sample.yaml +++ b/app/samples/openrocket_sensors/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: openrocket-sensors name: openrocket-sensors common: build_only: true diff --git a/app/samples/phase_detection/sample.yaml b/app/samples/phase_detection/sample.yaml index 4b07276d2..14591ee3e 100644 --- a/app/samples/phase_detection/sample.yaml +++ b/app/samples/phase_detection/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: phase-detection name: phase-detection common: build_only: true diff --git a/app/samples/sensor/sample.yaml b/app/samples/sensor/sample.yaml index d4f09450c..c366c18b9 100644 --- a/app/samples/sensor/sample.yaml +++ b/app/samples/sensor/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: sensor name: sensor common: build_only: true diff --git a/app/samples/shield_blinky/sample.yaml b/app/samples/shield_blinky/sample.yaml index af5939ba3..2d8656728 100644 --- a/app/samples/shield_blinky/sample.yaml +++ b/app/samples/shield_blinky/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: shield_blinky name: shield_blinky common: build_only: true diff --git a/app/samples/shield_mcp3561r/sample.yaml b/app/samples/shield_mcp3561r/sample.yaml index 9c9d16e19..772b1c2c9 100644 --- a/app/samples/shield_mcp3561r/sample.yaml +++ b/app/samples/shield_mcp3561r/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: shield_blinky name: shield_blinky common: build_only: true diff --git a/app/samples/sntp_client/sample.yaml b/app/samples/sntp_client/sample.yaml index 18e9ce154..48b84dd51 100644 --- a/app/samples/sntp_client/sample.yaml +++ b/app/samples/sntp_client/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: sntp-client name: sntp-client common: build_only: true diff --git a/app/samples/soft_timer/sample.yaml b/app/samples/soft_timer/sample.yaml index e1d6130e6..55bf7f4eb 100644 --- a/app/samples/soft_timer/sample.yaml +++ b/app/samples/soft_timer/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: soft-timer name: soft-timer common: build_only: true diff --git a/app/samples/tenants_and_tasks/sample.yaml b/app/samples/tenants_and_tasks/sample.yaml index 46382fab0..610ee107c 100644 --- a/app/samples/tenants_and_tasks/sample.yaml +++ b/app/samples/tenants_and_tasks/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: tenants-and-tasks name: tenants-and-tasks common: build_only: true diff --git a/app/samples/tftp_server/sample.yaml b/app/samples/tftp_server/sample.yaml index a0f662e3b..323087c9b 100644 --- a/app/samples/tftp_server/sample.yaml +++ b/app/samples/tftp_server/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: tftp-server name: tftp-server common: build_only: true diff --git a/app/samples/time_travel/sample.yaml b/app/samples/time_travel/sample.yaml index 07566857f..ac4144994 100644 --- a/app/samples/time_travel/sample.yaml +++ b/app/samples/time_travel/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: time-travel name: time-travel common: build_only: true diff --git a/app/samples/udp_bcast/sample.yaml b/app/samples/udp_bcast/sample.yaml index 9785820af..08f2eb08b 100644 --- a/app/samples/udp_bcast/sample.yaml +++ b/app/samples/udp_bcast/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: udp-bcast name: udp-bcast common: build_only: true diff --git a/app/samples/udp_rcv/sample.yaml b/app/samples/udp_rcv/sample.yaml index 958c322c1..bafbbdc74 100644 --- a/app/samples/udp_rcv/sample.yaml +++ b/app/samples/udp_rcv/sample.yaml @@ -1,5 +1,5 @@ sample: - description: + description: udp-rcv name: udp-rcv common: build_only: true From 9ed779ebd969c5331827546da0f92ca6ca92d16c Mon Sep 17 00:00:00 2001 From: Aaron Chan Date: Sun, 17 May 2026 11:43:19 -0400 Subject: [PATCH 3/3] Blast lora_bcast sample --- app/samples/lora_bcast/.idea/.gitignore | 6 ---- app/samples/lora_bcast/CMakeLists.txt | 8 ----- app/samples/lora_bcast/Kconfig | 14 -------- app/samples/lora_bcast/prj.conf | 31 ---------------- app/samples/lora_bcast/sample.yaml | 9 ----- app/samples/lora_bcast/src/main.cpp | 48 ------------------------- 6 files changed, 116 deletions(-) delete mode 100644 app/samples/lora_bcast/.idea/.gitignore delete mode 100644 app/samples/lora_bcast/CMakeLists.txt delete mode 100644 app/samples/lora_bcast/Kconfig delete mode 100644 app/samples/lora_bcast/prj.conf delete mode 100644 app/samples/lora_bcast/sample.yaml delete mode 100644 app/samples/lora_bcast/src/main.cpp diff --git a/app/samples/lora_bcast/.idea/.gitignore b/app/samples/lora_bcast/.idea/.gitignore deleted file mode 100644 index 8bf4d45d6..000000000 --- a/app/samples/lora_bcast/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/app/samples/lora_bcast/CMakeLists.txt b/app/samples/lora_bcast/CMakeLists.txt deleted file mode 100644 index fef1e0f39..000000000 --- a/app/samples/lora_bcast/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.13.1) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -project(lora-back-and-forth LANGUAGES C CXX) - -FILE(GLOB sources src/*.c src/*.cpp) -target_include_directories(app PRIVATE include) -target_sources(app PRIVATE ${sources}) diff --git a/app/samples/lora_bcast/Kconfig b/app/samples/lora_bcast/Kconfig deleted file mode 100644 index faf349deb..000000000 --- a/app/samples/lora_bcast/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024 RIT Launch Initiative -# SPDX-License-Identifier: Apache-2.0 - -menu "Zephyr" -source "Kconfig.zephyr" -endmenu - -module = APP -module-str = APP -source "subsys/logging/Kconfig.template.log_config" - -menuconfig RECEIVER - bool "Run receiver code" - default n diff --git a/app/samples/lora_bcast/prj.conf b/app/samples/lora_bcast/prj.conf deleted file mode 100644 index 75025f3e1..000000000 --- a/app/samples/lora_bcast/prj.conf +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2024 RIT Launch Initiative -# SPDX-License-Identifier: Apache-2.0 - -# CPP -CONFIG_CPP=y -CONFIG_REQUIRES_FULL_LIBCPP=y -CONFIG_STD_CPP20=y - -CONFIG_F_CORE=y -CONFIG_F_CORE_RADIO=y - -# OS -CONFIG_POLL=y -CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_STACK_USAGE=y - -CONFIG_TIMESLICING=y -CONFIG_TIMESLICE_SIZE=20 -CONFIG_TIMESLICE_PRIORITY=0 -CONFIG_THREAD_STACK_INFO=y - -CONFIG_DYNAMIC_THREAD=y -# Max stack size for dynamic threads -CONFIG_DYNAMIC_THREAD_STACK_SIZE=512 -# Number of threads in the dynamic thread pool -# (Zephyr wants 4 for some reason instead of 2) -CONFIG_DYNAMIC_THREAD_POOL_SIZE=4 -CONFIG_SHELL=y -CONFIG_LOG=y -CONFIG_LORA=y -CONFIG_LORA_SX127X=y diff --git a/app/samples/lora_bcast/sample.yaml b/app/samples/lora_bcast/sample.yaml deleted file mode 100644 index b9c58830e..000000000 --- a/app/samples/lora_bcast/sample.yaml +++ /dev/null @@ -1,9 +0,0 @@ -sample: - description: lora-back-and-forth - name: lora-back-and-forth -common: - build_only: true - platform_allow: - - radio_module -tests: - samples.lora_back_and_forth.default: {} diff --git a/app/samples/lora_bcast/src/main.cpp b/app/samples/lora_bcast/src/main.cpp deleted file mode 100644 index fd7147e2f..000000000 --- a/app/samples/lora_bcast/src/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2024 RIT Launch Initiative - * - * SPDX-License-Identifier: Apache-2.0 - */ - -// std Includes -#include - -// F-Core Includes -#include - -// Zephyr Includes -#include -#include -#include -#include - -LOG_MODULE_REGISTER(main); - -#ifdef CONFIG_RECEIVER -static bool receiveFinished = true; -#endif - -int main() { - CLora lora(*DEVICE_DT_GET(DT_ALIAS(lora))); - - while (true) { -#ifdef CONFIG_RECEIVER - if (receiveFinished) { - LOG_INF("Attempting to receive"); - lora.ReceiveAsynchronous([](const device*, uint8_t* data, uint16_t size, int16_t rssi, int8_t snr) { - LOG_INF("Async Received: %s\tRSSI: %d\t SNR:%d", data, rssi, snr); - receiveFinished = true; - }); - - receiveFinished = false; - } -#else - static constexpr std::string payload = "Launch!"; - lora.TransmitSynchronous(payload.c_str(), payload.size()); - LOG_INF("Sent: %s", payload.c_str()); -#endif - k_msleep(100); - } - - return 0; -}