add set_spreadfactor uart command

This commit is contained in:
Morgan Allen 2018-07-29 00:49:42 -07:00
parent 32926c30de
commit f15732251f

View file

@ -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,