Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/infuse/validation/lora.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ enum {
VALIDATION_LORA_TX = BIT(0),
/** Receive a packet */
VALIDATION_LORA_RX = BIT(1),
/** Perform channel activity detection */
VALIDATION_LORA_CAD = BIT(2),
};

/**
Expand Down
4 changes: 4 additions & 0 deletions samples/validation/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ configdefault SNTP_AUTO
configdefault INFUSE_IMU_SELF_TEST
default y

choice LORA_MODULE_BACKEND
default LORA_MODULE_BACKEND_LORA_BASICS_MODEM
endchoice

source "Kconfig.zephyr"
2 changes: 1 addition & 1 deletion samples/validation/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ K_THREAD_DEFINE(nrf_modem_thread, 2048, nrf_modem_validator, NULL, NULL, NULL, 5
#if CONFIG_LORA
static void lora_validation_run(const struct device *dev)
{
if (infuse_validation_lora(dev, VALIDATION_LORA_TX) == 0) {
if (infuse_validation_lora(dev, VALIDATION_LORA_TX | VALIDATION_LORA_CAD) == 0) {
atomic_inc(&validators_passed);
} else {
atomic_inc(&validators_failed);
Expand Down
21 changes: 21 additions & 0 deletions subsys/validation/validation_lora.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,27 @@ int infuse_validation_lora(const struct device *dev, uint8_t flags)
}
}

if (flags & VALIDATION_LORA_CAD) {
config.tx = false;
rc = lora_config(dev, &config);
if (rc < 0) {
VALIDATION_REPORT_ERROR(TEST, "RX Config failed (%d)", rc);
goto test_end;
}

/* Run CAD */
VALIDATION_REPORT_INFO(TEST, "Starting CAD");
rc = lora_cad(dev, 2);
if (rc == -ENOTSUP) {
VALIDATION_REPORT_INFO(TEST, "CAD not supported");
} else if (rc < 0) {
VALIDATION_REPORT_ERROR(TEST, "CAD failed (%d)", rc);
goto test_end;
} else {
VALIDATION_REPORT_VALUE(TEST, "CAD_RESULT", "%d", rc);
}
}

if (flags & VALIDATION_LORA_RX) {
config.tx = false;
rc = lora_config(dev, &config);
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ manifest:

projects:
- name: zephyr
revision: a4559311529e347b1d857b85a47004d7cf86b880
revision: 0740a0473aa748df0b431ca21c15181527b4c816
# Limit imported repositories to reduce clone time
import:
name-allowlist:
Expand Down
Loading