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:
- 16:3994aadbb37c
- Parent:
- 12:d0ca7c3c8962
- Child:
- 17:61e9a2208fac
diff -r b27ab44dc2c8 -r 3994aadbb37c serial_cmds.cpp --- a/serial_cmds.cpp Thu Apr 29 16:54:10 2021 +0000 +++ b/serial_cmds.cpp Fri Apr 30 13:46:57 2021 +0000 @@ -1,6 +1,6 @@ #include "serial.h" -bool SerialCommandRun(const char *msg) +bool SerialCommandRun(const char *msg, int msg_len) { char Option = msg[1]; /// recebo opcao @@ -27,7 +27,8 @@ 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); - send_msg((char*)(msg + 2)); + // 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;} }