samples: subsys: lorawan: class_a: add clock sync option

Add an option to build the sample with application-layer clock sync
service running in the background.

This will also add a build-check for the clock sync service in CI.

Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2022-10-24 18:31:19 +02:00 committed by Fabio Baltieri
commit 5dd50f9232
4 changed files with 28 additions and 0 deletions

View file

@ -24,3 +24,19 @@ The following commands build and flash the sample.
:board: nucleo_wl55jc
:goals: build flash
:compact:
Extended Configuration
**********************
This sample can be configured to run the application-layer clock
synchronization service in the background.
The following commands build and flash the sample with clock synchronization
enabled.
.. zephyr-app-commands::
:zephyr-app: samples/subsys/lorawan/class_a
:board: nucleo_wl55jc
:goals: build flash
:gen-args: -DOVERLAY_CONFIG=overlay-clock-sync.conf
:compact:

View file

@ -0,0 +1,3 @@
CONFIG_LORAWAN_SERVICES=y
CONFIG_LORAWAN_SERVICES_LOG_LEVEL_DBG=y
CONFIG_LORAWAN_APP_CLOCK_SYNC=y

View file

@ -44,3 +44,8 @@ tests:
extra_configs:
- CONFIG_LORAMAC_REGION_EU868=y
- CONFIG_LORAMAC_REGION_US915=y
sample.lorawan.class_a.clock_sync:
extra_args: OVERLAY_CONFIG="overlay-clock-sync.conf"
filter: CONFIG_ENTROPY_HAS_DRIVER
integration_platforms:
- nucleo_wl55jc

View file

@ -98,6 +98,10 @@ void main(void)
return;
}
#ifdef CONFIG_LORAWAN_APP_CLOCK_SYNC
lorawan_clock_sync_run();
#endif
LOG_INF("Sending data...");
while (1) {
ret = lorawan_send(2, data, sizeof(data),