Simple RPC functionality to work with Visual Studio GUI application
Dependencies: 4DGL-uLCD-SE RPCInterface mbed
Revision 0:3c342a2555ef, committed 2018-05-01
- Comitter:
- Nydrel
- Date:
- Tue May 01 07:46:31 2018 +0000
- Commit message:
- Changed RPCInterface to support RPC arguments of type *char
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/4DGL-uLCD-SE.lib Tue May 01 07:46:31 2018 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/4180_1/code/4DGL-uLCD-SE/#2cb1845d7681
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPCInterface.lib Tue May 01 07:46:31 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Nydrel/code/RPCInterface/#4fce2f9535b2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue May 01 07:46:31 2018 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "mbed_rpc.h"
+#include "uLCD_4DGL.h"
+#include <ctype.h>
+
+/**
+ * This example program has been updated to use the RPC implementation in the new mbed libraries.
+ * This example shows the uses of the RPCDigitalOut wrapper class
+ */
+
+//Use the RPC enabled wrapped class - see RpcClasses.h for more info
+Serial pc(USBTX, USBRX);
+PinName tx, rx, rst;
+uLCD_4DGL uLCD(p28, p27, p29);
+char text;
+//string screen;
+
+void clearLCD(Arguments *in, Reply *out);
+RPCFunction rpcClear(&clearLCD, "clearLCD");
+
+void printLCD(Arguments *in, Reply *out);
+RPCFunction rpcPrint(&printLCD, "printLCD");
+
+int main() {
+
+ char buf[256], outbuf[256];
+ while(1) {
+ pc.gets(buf, 256);
+ //Call the static call method on the RPC class
+ RPC::call(buf, outbuf);
+ pc.printf("%s\n", outbuf);
+ }
+}
+
+void clearLCD(Arguments *in, Reply *out)
+{
+ uLCD.cls();
+ //out->putData("Successfully created uLCD object!");
+}
+
+void printLCD(Arguments *in, Reply *out)
+{
+ char * text = in->getArg<char *>();
+ uLCD.puts(text);
+ uLCD.puts("\n");
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue May 01 07:46:31 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/994bdf8177cb \ No newline at end of file