Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 439 → Rev 440

/QMK-Groundstation/branches/libMK/libMK/Parser.h
0,0 → 1,38
#ifndef PARSER_H
#define PARSER_H
#include <string>
#include <cmath>
 
/**
* The Parser gets values from the Mikrokopter-USART interface
* and parses them into a sRxData-Struct
*/
 
using namespace std;
 
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(string TX);
static bool check_CRC(string RX);
 
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