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.
main.cpp
00001 #include "mbed.h" 00002 #include "mbed_rpc.h" 00003 00004 Serial pc(USBTX, USBRX); 00005 00006 int main() { 00007 char buf[256], outbuf[256]; 00008 00009 // setup the classes that can be created dynamically 00010 // RPC::add_rpc_class<RpcAnalogIn>(); 00011 // RPC::add_rpc_class<RpcAnalogOut>(); 00012 RPC::add_rpc_class<RpcDigitalIn>(); 00013 RPC::add_rpc_class<RpcDigitalOut>(); 00014 RPC::add_rpc_class<RpcDigitalInOut>(); 00015 RPC::add_rpc_class<RpcPwmOut>(); 00016 RPC::add_rpc_class<RpcTimer>(); 00017 RPC::add_rpc_class<RpcSPI>(); 00018 RPC::add_rpc_class<RpcSerial>(); 00019 00020 // receive commands, and send back the responses 00021 while(1) { 00022 pc.gets(buf, 256); 00023 RPC::call(buf, outbuf); 00024 pc.printf("%s\r\n", outbuf); 00025 } 00026 }
Generated on Thu Jul 21 2022 12:35:39 by
1.7.2