From f15732251fd90c8cb065b7b78c6dbf5f71de8197 Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Sun, 29 Jul 2018 00:49:42 -0700 Subject: [PATCH] add set_spreadfactor uart command --- test/lora32/main/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/lora32/main/main.c b/test/lora32/main/main.c index 31893df..20fbf27 100644 --- a/test/lora32/main/main.c +++ b/test/lora32/main/main.c @@ -125,6 +125,14 @@ void send(void *args) { lora32_send(&lora, (uint8_t *)args, 12); }; +void set_spreadfactor(void *args) { + uint32_t sf = atoi(args); + + ESP_LOGI(TAG, "spreadfactor: %d", sf); + + lora32_set_spreadfactor(&lora, sf); +} + void app_main() { esp_err_t ret; @@ -149,6 +157,7 @@ void app_main() { ucmdr_init(); ucmdr_install("send", send); ucmdr_install("dump", dump_mem); + ucmdr_install("sf", set_spreadfactor); uart_config_t uart_config = { .baud_rate = 115200,