2018-12-18 22:33:37 +00:00
|
|
|
/*
|
2019-02-04 13:02:09 +00:00
|
|
|
* File: M10Gtop.h
|
2018-12-18 22:33:37 +00:00
|
|
|
* Author: Viproz
|
|
|
|
* Used code from rs1729
|
|
|
|
* Created on December 13, 2018, 4:39 PM
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef M10PTU_H
|
|
|
|
#define M10PTU_H
|
|
|
|
#define FRAME_LEN (100+1) // 0x64+1
|
|
|
|
#define AUX_LEN 20
|
2018-12-19 19:50:04 +00:00
|
|
|
#define DATA_LENGTH (FRAME_LEN + AUX_LEN + 2)
|
2018-12-18 22:33:37 +00:00
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include "M10GeneralParser.h"
|
|
|
|
|
2019-02-04 13:02:09 +00:00
|
|
|
class M10TrimbleParser : public M10GeneralParser {
|
2018-12-18 22:33:37 +00:00
|
|
|
public:
|
2019-02-04 13:02:09 +00:00
|
|
|
M10TrimbleParser();
|
|
|
|
virtual ~M10TrimbleParser();
|
2018-12-19 19:50:04 +00:00
|
|
|
virtual void changeData(std::array<unsigned char, DATA_LENGTH> data, bool good);
|
2018-12-18 22:33:37 +00:00
|
|
|
virtual double getLatitude();
|
|
|
|
virtual double getLongitude();
|
|
|
|
virtual double getAltitude();
|
|
|
|
virtual int getDay();
|
|
|
|
virtual int getMonth();
|
|
|
|
virtual int getYear();
|
|
|
|
virtual int getHours();
|
|
|
|
virtual int getMinutes();
|
|
|
|
virtual int getSeconds();
|
2019-03-03 21:22:11 +00:00
|
|
|
virtual int getSatellites();
|
2018-12-18 22:33:37 +00:00
|
|
|
virtual double getVerticalSpeed();
|
|
|
|
virtual double getHorizontalSpeed();
|
|
|
|
virtual double getDirection();
|
|
|
|
virtual double getTemperature();
|
|
|
|
virtual double getHumidity();
|
|
|
|
virtual double getDp();
|
2019-03-03 21:22:11 +00:00
|
|
|
virtual double getBatteryLevel();
|
2018-12-18 22:33:37 +00:00
|
|
|
virtual std::string getSerialNumber();
|
2018-12-28 22:33:46 +00:00
|
|
|
virtual std::string getdxlSerialNumber();
|
|
|
|
|
|
|
|
virtual std::array<unsigned char, DATA_LENGTH> replaceWithPrevious(std::array<unsigned char, DATA_LENGTH> data);
|
2018-12-18 22:33:37 +00:00
|
|
|
|
|
|
|
void printFrame();
|
|
|
|
private:
|
|
|
|
void gps2Date(long GpsWeek, long GpsSeconds, int *Year, int *Month, int *Day);
|
2018-12-28 22:33:46 +00:00
|
|
|
std::array<bool, DATA_LENGTH> frameSpaces;
|
2018-12-18 22:33:37 +00:00
|
|
|
int week;
|
|
|
|
int time;
|
|
|
|
int year;
|
|
|
|
int month;
|
|
|
|
int day;
|
|
|
|
|
2018-12-28 22:33:46 +00:00
|
|
|
static char similarData[];
|
|
|
|
static char insertSpaces[];
|
2018-12-18 22:33:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* M10GTOP_H */
|
|
|
|
|