Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
391 | Brean | 1 | #ifndef PARSER_H |
2 | #define PARSER_H |
||
3 | #include <string> |
||
4 | |||
5 | /** |
||
6 | * The Parser gets values from the Mikrokopter-USART interface |
||
7 | * and parses them into a sRxData-Struct |
||
8 | */ |
||
9 | |||
10 | struct sRxData |
||
11 | { |
||
12 | char *input; |
||
13 | string str; |
||
14 | int decode[150]; |
||
15 | int decLen; |
||
16 | }; |
||
17 | |||
18 | class Parser { |
||
19 | public: |
||
393 | Brean | 20 | static bool decode64(sRxData &rx); |
21 | static string encode64(char data[150],unsigned int length); |
||
391 | Brean | 22 | |
393 | Brean | 23 | static string add_CRC(char * TX, int length); |
24 | static string check_CRC(char * RX, int length); |
||
391 | Brean | 25 | |
26 | static float getFloat(long value, int count); |
||
27 | |||
28 | static int dataToInt(int *Data , int Start, bool is_signed = true); |
||
29 | static long dataToLong(int *Data , int Start, bool is_signed = true); |
||
30 | static int dataToChar(int *data , int start, bool is_signed = true); |
||
31 | static string dataToString(int Data[150], int Start = 0, int End = 150); |
||
32 | static int charToData(int data); |
||
33 | }; |
||
34 | |||
35 | #endif |