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