Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Committer:
xinlei
Date:
Mon Aug 08 11:05:57 2016 +0000
Revision:
138:f8ab852e83e7
Parent:
107:f1ee3e1eb126
Etisalat and Teleena APN.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
xinlei 93:61d44636f020 1 #ifndef CONTROLPARSER_H
xinlei 93:61d44636f020 2 #define CONTROLPARSER_H
xinlei 93:61d44636f020 3 #include "Operation.h"
xinlei 93:61d44636f020 4 #include "lex.h"
xinlei 93:61d44636f020 5
xinlei 93:61d44636f020 6 enum BayeuxAdvice{ BA_RETRY, BA_HANDSHAKE, BA_NONE };
xinlei 93:61d44636f020 7
xinlei 93:61d44636f020 8 class ControlParser
xinlei 93:61d44636f020 9 {
xinlei 93:61d44636f020 10 public:
xinlei 107:f1ee3e1eb126 11 ControlParser(OperationPool& pool): opType(0), bayeuxAdvice(BA_RETRY),
xinlei 107:f1ee3e1eb126 12 bayeuxTimeout(-1), bayeuxInterval(0), opool(pool) {}
xinlei 93:61d44636f020 13 virtual ~ControlParser() {}
xinlei 93:61d44636f020 14 BayeuxAdvice getBayeuxAdvice() const { return bayeuxAdvice; }
xinlei 93:61d44636f020 15 int getBayeuxInterval() const { return bayeuxInterval; }
xinlei 93:61d44636f020 16 int getBayeuxTimeout() const { return bayeuxTimeout; }
xinlei 98:e369fc75c000 17 void parse(const char*);
xinlei 93:61d44636f020 18 protected:
xinlei 100:dbcd3bc51758 19 typedef void (ControlParser::*PtrParseFunc)(Token&);
xinlei 93:61d44636f020 20 void parseAdviceInterval(Token& tok);
xinlei 93:61d44636f020 21 void parseAdvicePolicy(Token& tok);
xinlei 93:61d44636f020 22 void parseAdviceTimeout(Token& tok);
xinlei 93:61d44636f020 23 void parseBayeuxAdvice(Token& tok);
xinlei 93:61d44636f020 24 void parseError(Token& tok);
xinlei 93:61d44636f020 25 void parseGetOp(Token& tok);
xinlei 93:61d44636f020 26 void parseGetOpOrBayeuxAdvice(Token& tok);
xinlei 93:61d44636f020 27 void parseOpData(Token& tok);
xinlei 93:61d44636f020 28 void parseOpId(Token& tok);
xinlei 93:61d44636f020 29 void parseOpState(Token& tok);
xinlei 93:61d44636f020 30 void parseOpType(Token& tok);
xinlei 93:61d44636f020 31 void parseRecover(Token& tok);
xinlei 100:dbcd3bc51758 32 void parseRowNumber(Token& tok);
xinlei 93:61d44636f020 33 private:
xinlei 94:010b0f7a0a1a 34 unsigned short opType;
xinlei 93:61d44636f020 35 Operation op;
xinlei 93:61d44636f020 36 BayeuxAdvice bayeuxAdvice;
xinlei 93:61d44636f020 37 int bayeuxTimeout;
xinlei 93:61d44636f020 38 int bayeuxInterval;
xinlei 93:61d44636f020 39 PtrParseFunc ptrPF;
xinlei 93:61d44636f020 40 OperationPool& opool;
xinlei 93:61d44636f020 41 };
xinlei 93:61d44636f020 42
xinlei 93:61d44636f020 43 #endif /* CONTROLPARSER_H */