Rev 391 |
Blame |
Last modification |
View Log
| RSS feed
#ifndef PARSER_H
#define PARSER_H
#include <string>
/**
* The Parser gets values from the Mikrokopter-USART interface
* and parses them into a sRxData-Struct
*/
struct sRxData
{
char *input;
string str;
int decode[150];
int decLen;
};
class Parser {
public:
static bool decode64(sRxData &rx);
static string encode64(char data[150],unsigned int length);
static string add_CRC(char * TX, int length);
static string check_CRC(char * RX, int length);
static float getFloat(long value, int count);
static int dataToInt(int *Data , int Start, bool is_signed = true);
static long dataToLong(int *Data , int Start, bool is_signed = true);
static int dataToChar(int *data , int start, bool is_signed = true);
static string dataToString(int Data[150], int Start = 0, int End = 150);
static int charToData(int data);
};
#endif