playing with rpc

Fork of mbed-rpc by Andrew p

Revision:
9:228c68184e71
Parent:
1:6919289a5946
diff -r fece2d5e8d96 -r 228c68184e71 Arguments.cpp
--- a/Arguments.cpp	Mon Feb 09 09:15:22 2015 +0000
+++ b/Arguments.cpp	Fri Apr 24 00:51:09 2015 +0000
@@ -98,6 +98,12 @@
     return atof(argv[index]);
 }
 
+template<> uint16_t Arguments::getArg<uint16_t>(void) {
+    index++;
+    char *pEnd;
+    return (uint16_t)(strtol(argv[index], &pEnd, 10) & 0xffff);
+}
+
 Reply::Reply(char* r) {
     first = true;
     *r = '\0';
@@ -137,4 +143,9 @@
     reply += sprintf(reply, "%.17g", f);
 }
 
+template<> void Reply::putData<unsigned short>(unsigned short uint16) {
+    separator();
+    reply += sprintf(reply, "%u", uint16);
+}
+
 } // namespace mbed