RTOS Support.
Dependents: SerialRPC_rtos_example
Fork of RPCInterface by
Diff: SerialRPCInterface.h
- Revision:
- 9:2aa76667c340
- Parent:
- 5:56fd0b265aba
--- a/SerialRPCInterface.h Sat Jan 28 19:12:00 2012 +0000 +++ b/SerialRPCInterface.h Thu Apr 09 18:02:10 2015 +0000 @@ -32,10 +32,14 @@ *Includes */ #include "mbed.h" +#include "rtos.h" #include "platform.h" #include "rpc.h" #include "RPCFunction.h" #include "RPCVariable.h" +#include "RpcClasses.h" + +#define PROCESS_THREAD 1 namespace mbed{ @@ -73,18 +77,26 @@ void Enable(void); //The Serial Port - Serial pc; + RawSerial pc; private: + typedef struct { + char command[256]; + } mail_t; + //Handle messgaes and take appropriate action + static void _MsgProcessStarter(const void *args); void _MsgProcess(void); void _RegClasses(void); void _RPCSerial(); bool _enabled; char _command[256]; + char* _command_ptr; char _response[256]; bool _RPCflag; + Thread _thread; + Mail<mail_t, 8> _commandMail; }; } #endif \ No newline at end of file