5 years, 1 month ago.

Problem making RPC work

Hi everyone, I been away for a while, and i little rusty on the mbed. I try to make a RPC connection work on an LPC1768. Because my earlier tries did not work, I first tried the cookbook examples, but i can't even make them work.

The code i used:

  1. include "mbed.h"
  2. include "mbed_rpc.h"

/**

  • This example program has been updated to use the RPC implementation in the new mbed libraries.
  • This example demonstrates using RPC over serial
  • /

Use the RPC enabled wrapped class - see RpcClasses.h for more info RpcDigitalOut myled(LED4,"myled");

Serial pc(USBTX, USBRX); int main() { The mbed RPC classes are now wrapped to create an RPC enabled version - see RpcClasses.h so don't add to base class

receive commands, and send back the responses char buf[256], outbuf[256]; while(1) { pc.printf("running"); pc.gets(buf, 256); Call the static call method on the RPC class pc.printf(buf); RPC::call(buf, outbuf); pc.printf("%s\n", outbuf); } }

but even the pc.printf(buf) doesn't give an result on my terminal. Can anybody tell me what I am doing wrong?

Be the first to answer this question.