contain lorawan with serial_rx enabled
Dependencies: pulga-lorawan-drv SPI_MX25R Si1133 BME280
serial_cmds.cpp@64:ed68ddac6360, 2021-03-02 (annotated)
- Committer:
- ruschigo
- Date:
- Tue Mar 02 16:57:31 2021 +0000
- Revision:
- 64:ed68ddac6360
- Parent:
- 63:4ec1808fb547
- Child:
- 65:4090220e19d2
testing Lora Splited
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ruschigo | 62:89df9529dbb0 | 1 | #include "serial.h" |
ruschigo | 62:89df9529dbb0 | 2 | |
ruschigo | 64:ed68ddac6360 | 3 | |
ruschigo | 62:89df9529dbb0 | 4 | bool SerialCommandRun(const char *msg) |
ruschigo | 62:89df9529dbb0 | 5 | { |
ruschigo | 62:89df9529dbb0 | 6 | char Option = msg[1]; /// recebo opcao |
ruschigo | 62:89df9529dbb0 | 7 | |
ruschigo | 62:89df9529dbb0 | 8 | switch (Option) |
ruschigo | 62:89df9529dbb0 | 9 | { |
ruschigo | 62:89df9529dbb0 | 10 | |
ruschigo | 62:89df9529dbb0 | 11 | case CMD_PRINT_LAST_GPS: |
ruschigo | 63:4ec1808fb547 | 12 | int local_lat, local_log; |
ruschigo | 63:4ec1808fb547 | 13 | //gps_get_lat_lon(&local_lat, &local_log); |
ruschigo | 63:4ec1808fb547 | 14 | //get_latitude |
ruschigo | 63:4ec1808fb547 | 15 | pc.printf("<g%d,%d\n>", get_latitude(), get_longitude()); |
ruschigo | 62:89df9529dbb0 | 16 | break; |
ruschigo | 64:ed68ddac6360 | 17 | |
ruschigo | 64:ed68ddac6360 | 18 | case CMD_SEND_HELLO: |
ruschigo | 64:ed68ddac6360 | 19 | pc.printf("<hHELLOANTONIO>"); |
ruschigo | 64:ed68ddac6360 | 20 | char hello[100] = "Ola Antonio!\n"; |
ruschigo | 64:ed68ddac6360 | 21 | int ret; |
ruschigo | 64:ed68ddac6360 | 22 | ret = lora_send_message((uint8_t*)hello, (uint16_t)sizeof(hello)); |
ruschigo | 64:ed68ddac6360 | 23 | if(ret > 0) |
ruschigo | 64:ed68ddac6360 | 24 | pc.printf("Send OK\n"); |
ruschigo | 64:ed68ddac6360 | 25 | else |
ruschigo | 64:ed68ddac6360 | 26 | pc.printf("Fail to Send\n"); |
ruschigo | 64:ed68ddac6360 | 27 | |
ruschigo | 64:ed68ddac6360 | 28 | break; |
ruschigo | 62:89df9529dbb0 | 29 | |
ruschigo | 62:89df9529dbb0 | 30 | } |
ruschigo | 62:89df9529dbb0 | 31 | |
ruschigo | 62:89df9529dbb0 | 32 | return true; |
ruschigo | 62:89df9529dbb0 | 33 | } |