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.
Fork of RPC_Serial by
main.cpp
- Committer:
- apullin
- Date:
- 2015-04-23
- Revision:
- 1:c7b247964631
- Parent:
- 0:3ffd66df9efb
- Child:
- 2:fe5692354530
File content as of revision 1:c7b247964631:
#include "mbed.h" #include "rpc.h" Serial pc(USBTX, USBRX); int main() { // setup the classes that can be created dynamically RPC::add_rpc_class<AnalogIn>(); RPC::add_rpc_class<AnalogOut>(); RPC::add_rpc_class<DigitalIn>(); RPC::add_rpc_class<DigitalOut>(); RPC::add_rpc_class<DigitalInOut>(); RPC::add_rpc_class<PwmOut>(); RPC::add_rpc_class<Timer>(); RPC::add_rpc_class<SPI>(); RPC::add_rpc_class<BusOut>(); RPC::add_rpc_class<BusIn>(); RPC::add_rpc_class<BusInOut>(); RPC::add_rpc_class<Serial>(); // receive commands, and send back the responses char buf[256], outbuf[256]; while(1) { pc.gets(buf, 256); rpc(buf, outbuf); pc.printf("%s\n", outbuf); } }