Mike Spadaru / physcom
Embed: (wiki syntax)

« Back to documentation index

RPCFunction Class Reference

Class to call custom functions over RPC For details see rpc.h. More...

#include <RPCFunction.h>

Inherits physcom::RPC.

Public Member Functions

 RPCFunction (void(*f)(char *, char *), const char *=NULL)
 Constructor.

Static Public Member Functions

static bool call (char *input, char *output)
 Static method.

Detailed Description

Class to call custom functions over RPC For details see rpc.h.

Definition at line 14 of file RPCFunction.h.


Constructor & Destructor Documentation

RPCFunction ( void(*)(char *, char *)  f,
const char *  name = NULL 
)

Constructor.

Parameters:
fPointer to the function to call. the function must be of the form void foo(char * input, char * output)
nameThe name of this object

Definition at line 5 of file RPCFunction.cpp.


Member Function Documentation

bool call ( char *  input,
char *  output 
) [static, inherited]

Static method.

Should be called everytime input is read on the serial connection. RPC::call(input, output) will parse the input and call the apropriate RPCFunction to compute the output and populate the result string.

Parameters:
Inputstring received from the serial connection
Outputstring rcomputed by executing the RPC function. Should be sent back to the caller over the serial connection.

Definition at line 46 of file rpc.cpp.