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
00001 #include "mbed.h" 00002 #include "rpc.h" 00003 00004 Serial pc(USBTX, USBRX); 00005 00006 int main() { 00007 // setup the classes that can be created dynamically 00008 Base::add_rpc_class<AnalogIn>(); 00009 Base::add_rpc_class<AnalogOut>(); 00010 Base::add_rpc_class<DigitalIn>(); 00011 Base::add_rpc_class<DigitalOut>(); 00012 Base::add_rpc_class<DigitalInOut>(); 00013 Base::add_rpc_class<PwmOut>(); 00014 Base::add_rpc_class<Timer>(); 00015 Base::add_rpc_class<SPI>(); 00016 Base::add_rpc_class<BusOut>(); 00017 Base::add_rpc_class<BusIn>(); 00018 Base::add_rpc_class<BusInOut>(); 00019 Base::add_rpc_class<Serial>(); 00020 // receive commands, and send back the responses 00021 char buf[256], outbuf[256]; 00022 while(1) { 00023 pc.gets(buf, 256); 00024 rpc(buf, outbuf); 00025 pc.printf("%s\n", outbuf); 00026 } 00027 }
Generated on Thu Jul 21 2022 05:04:42 by
1.7.2
