Suga koubou
/
MyRPC_Serial
http://mbed.org/users/okini3939/notebook/RPC_jp/
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "rpc.h" 00003 #include "MyRPC.h" 00004 00005 Serial pc(USBTX, USBRX); 00006 00007 int main() { 00008 // setup the classes that can be created dynamically 00009 Base::add_rpc_class<MyRPC>(); 00010 00011 // receive commands, and send back the responses 00012 char buf[256], outbuf[256]; 00013 while(1) { 00014 pc.gets(buf, 256); 00015 rpc(buf, outbuf); 00016 pc.printf("%s\n", outbuf); 00017 } 00018 }
Generated on Fri Jul 15 2022 07:42:47 by 1.7.2