contain lorawan with serial_rx enabled
Dependencies: pulga-lorawan-drv SPI_MX25R Si1133 BME280
Diff: serial_cmds.cpp
- Revision:
- 65:4090220e19d2
- Parent:
- 64:ed68ddac6360
--- a/serial_cmds.cpp Tue Mar 02 16:57:31 2021 +0000 +++ b/serial_cmds.cpp Tue Mar 02 18:22:16 2021 +0000 @@ -16,15 +16,21 @@ break; case CMD_SEND_HELLO: - pc.printf("<hHELLOANTONIO>"); - char hello[100] = "Ola Antonio!\n"; + pc.printf("<hHello>"); + char hello[100] = "helloWord\n"; int ret; - ret = lora_send_message((uint8_t*)hello, (uint16_t)sizeof(hello)); - if(ret > 0) + ret = lora_send_message((uint8_t*)hello, (uint16_t)strlen(hello)); + if(ret > 0){ pc.printf("Send OK\n"); - else + } + else{ + ret == LORAWAN_STATUS_WOULD_BLOCK ? pc.printf("send - WOULD BLOCK\r\n") : pc.printf("\r\n send() Error \r\n"); + //if (ret == LORAWAN_STATUS_WOULD_BLOCK) { + //retry in 3 seconds + //if (MBED_CONF_LORA_DUTY_CYCLE_ON) { + //ev_queue.call_in(10000, send_message); pc.printf("Fail to Send\n"); - + } break; }