Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: pulga-lorawan-drv SX1272
Diff: serial_cmds.cpp
- Revision:
- 17:61e9a2208fac
- Parent:
- 16:3994aadbb37c
- Child:
- 18:245a2285053c
--- a/serial_cmds.cpp Fri Apr 30 13:46:57 2021 +0000 +++ b/serial_cmds.cpp Fri Apr 30 17:03:48 2021 +0000 @@ -21,16 +21,15 @@ case CMD_SEND_LORA_P2P: { - char *temp; - gps_navPVT gps_data; - gps_data = get_struct(); - pc.printf("<p%s>", msg+2); - //sprintf((char*) temp ,"<t%d/%d/%d-%d:%d:%d>\n", (int)gps_data.year, (int)gps_data.month,(int)gps_data.day, (int)gps_data.hour, (int)gps_data.min, (int)gps_data.sec); - //pc.printf(temp); - // msg = <pDATA\0, so + 2 selects only DATA\0, and -2 discounts the chars <p - send_msg((char*)(msg + 2), (uint8_t)(msg_len - 2)); - //send_msg((char*)temp); - break;} + pc.printf("CMD_SEND_LORA_P2P: "); + for (int i = 0; i < msg_len; i++) { + pc.printf("%c", msg[i]); + } + + pc.printf("\n"); + // msg = <p2DATA, so + 3 selects only DATA\0, and -3 discounts the chars <p2 + send_msg((char*)(msg + 3), (uint8_t)(msg_len - 3)); + break;} } return true;