Webserver for peach-board
RPCCommand.h@0:6ec14f880a00, 2015-03-04 (annotated)
- Committer:
- thudt90
- Date:
- Wed Mar 04 02:16:31 2015 +0000
- Revision:
- 0:6ec14f880a00
add webserver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thudt90 | 0:6ec14f880a00 | 1 | #ifndef RPCCOMMAND |
thudt90 | 0:6ec14f880a00 | 2 | #define RPCCOMMAND |
thudt90 | 0:6ec14f880a00 | 3 | |
thudt90 | 0:6ec14f880a00 | 4 | #include <list> |
thudt90 | 0:6ec14f880a00 | 5 | #include "mbed_rpc.h" |
thudt90 | 0:6ec14f880a00 | 6 | |
thudt90 | 0:6ec14f880a00 | 7 | enum RPC_COMMAND_TYPE { INVALID, CREATE, DELETE, FUNCTION_CALL }; |
thudt90 | 0:6ec14f880a00 | 8 | |
thudt90 | 0:6ec14f880a00 | 9 | struct rpc_arg |
thudt90 | 0:6ec14f880a00 | 10 | { |
thudt90 | 0:6ec14f880a00 | 11 | char *name; |
thudt90 | 0:6ec14f880a00 | 12 | char *val; |
thudt90 | 0:6ec14f880a00 | 13 | }; |
thudt90 | 0:6ec14f880a00 | 14 | |
thudt90 | 0:6ec14f880a00 | 15 | class RPCCommand |
thudt90 | 0:6ec14f880a00 | 16 | { |
thudt90 | 0:6ec14f880a00 | 17 | public : |
thudt90 | 0:6ec14f880a00 | 18 | |
thudt90 | 0:6ec14f880a00 | 19 | RPCCommand(); |
thudt90 | 0:6ec14f880a00 | 20 | |
thudt90 | 0:6ec14f880a00 | 21 | bool decode(char *buffer); |
thudt90 | 0:6ec14f880a00 | 22 | |
thudt90 | 0:6ec14f880a00 | 23 | char* get_cmd() const; |
thudt90 | 0:6ec14f880a00 | 24 | RPC_COMMAND_TYPE get_type() const; |
thudt90 | 0:6ec14f880a00 | 25 | char* get_obj_name() const; |
thudt90 | 0:6ec14f880a00 | 26 | char* get_func_name() const; |
thudt90 | 0:6ec14f880a00 | 27 | |
thudt90 | 0:6ec14f880a00 | 28 | private : |
thudt90 | 0:6ec14f880a00 | 29 | |
thudt90 | 0:6ec14f880a00 | 30 | char cmd[RPC_MAX_STRING]; |
thudt90 | 0:6ec14f880a00 | 31 | char* obj_name; |
thudt90 | 0:6ec14f880a00 | 32 | char* func_name; |
thudt90 | 0:6ec14f880a00 | 33 | }; |
thudt90 | 0:6ec14f880a00 | 34 | |
thudt90 | 0:6ec14f880a00 | 35 | #endif |
thudt90 | 0:6ec14f880a00 | 36 |