Java & MBED: Functions.

02 Jun 2011

First of all : mbed rocks! I got PWM up and running within 1h from getting the device out of the package. This leaves enough time for playing around, like setting the carrier frequency via LAN ( Imagin a 10kW inverter "singing" the StarWars theme ).

LAN is working, the LED blink like intended in http://mbed.org/cookbook/Interfacing-with-Java

But the RPC-Functions / Variable dont work:

mbed:

int main() {
    void foo(char * input, char * output);
        //Attach it to an RPC object
    RPCFunction rpc_foo(&foo, "foo");
..
}
void foo(char * input, char * output){
 sprintf(output, "%f", 1.2);
}

java:

foo = new RPCFunction(mbed, "foo");

System.out.println("foo: "+foo.read());

yields : foo: empty

what am I missing?