mbed(SerialHalfDuplex入り)
Fork of mbed by
Revision 6:3fd6a337c7cc, committed 2009-01-23
- Comitter:
- simon.ford@mbed.co.uk
- Date:
- Fri Jan 23 14:15:56 2009 +0000
- Parent:
- 5:62573be585e9
- Child:
- 7:15d74db76485
- Commit message:
- Improved RPC handling
Changed in this revision
mbed.ar | Show annotated file Show diff for this revision Revisions of this file |
rpc.h | Show annotated file Show diff for this revision Revisions of this file |
Binary file mbed.ar has changed
--- a/rpc.h Thu Jan 22 18:32:40 2009 +0000 +++ b/rpc.h Fri Jan 23 14:15:56 2009 +0000 @@ -98,7 +98,7 @@ template<> inline char *parse_arg<char*>(const char *arg, const char **next) { const char *ptr = arg; - while(*ptr != 0 && *ptr != ' ' && *ptr != ',') { + while(*ptr >= '!' && *ptr != ',') { ptr++; } int len = ptr-arg; @@ -194,11 +194,19 @@ /* string */ template<> inline void write_result<char*>(char *val, char *result) { - strcpy(result, val); + if(val==NULL) { + result[0] = 0; + } else { + strcpy(result, val); + } } template<> inline void write_result<const char*>(const char *val, char *result) { - strcpy(result, val); + if(val==NULL) { + result[0] = 0; + } else { + strcpy(result, val); + } }