Bmag incl gps rettelse

Dependencies:   mbed WDT MODSERIAL BME280

Committer:
MAA
Date:
Thu Mar 02 14:04:56 2017 +0000
Revision:
4:c70ef089a3fd
Parent:
2:39c4a85dc2a4
Child:
5:11782a2008c2
Long and Lat calculation in decimal degrees implemented.; SPS file format begun.;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MAA 2:39c4a85dc2a4 1 #include <string>
MAA 2:39c4a85dc2a4 2
MAA 0:b3313c5ffca3 3 #define LINESTART '>'
MAA 0:b3313c5ffca3 4 #define LINESTOP '<'
MAA 0:b3313c5ffca3 5 #define HEADEREND '|'
MAA 0:b3313c5ffca3 6 #define SPACE ' '
MAA 0:b3313c5ffca3 7
MAA 4:c70ef089a3fd 8 #define P_16 0xA001
MAA 4:c70ef089a3fd 9
MAA 2:39c4a85dc2a4 10 using std::string;
MAA 2:39c4a85dc2a4 11
MAA 0:b3313c5ffca3 12 class SPS{
MAA 0:b3313c5ffca3 13 public:
MAA 0:b3313c5ffca3 14 //default constructor
MAA 0:b3313c5ffca3 15 SPS();
MAA 4:c70ef089a3fd 16
MAA 4:c70ef089a3fd 17
MAA 4:c70ef089a3fd 18 //Updates current string
MAA 2:39c4a85dc2a4 19 void UpdateCurrentString(string tag, string identifier_id, string group_id, string date, string time, string ZZZ,string s1, string source_id, string interpreter_id, string data_line_version, string encoding, string source_firmware_version, string interpreter_firmware_version, string latitude, string longitude, char gpsFixFlag, string mag_time, string mag_nt, string mag_sq);
MAA 2:39c4a85dc2a4 20
MAA 4:c70ef089a3fd 21 //Fills the array for calculation of the CRC-16 with values
MAA 4:c70ef089a3fd 22 void init_crc16_tab();
MAA 2:39c4a85dc2a4 23
MAA 4:c70ef089a3fd 24 // The function update_crc_16 calculates a new CRC-16 value based on the
MAA 4:c70ef089a3fd 25 // previous value of the CRC and the next byte of the data to be checked.
MAA 4:c70ef089a3fd 26 unsigned short update_crc_16(unsigned short crc, char c)
MAA 4:c70ef089a3fd 27
MAA 4:c70ef089a3fd 28
MAA 4:c70ef089a3fd 29 private:
MAA 2:39c4a85dc2a4 30 string currentString;
MAA 2:39c4a85dc2a4 31 string currentErrString;
MAA 4:c70ef089a3fd 32 string headerString;
MAA 4:c70ef089a3fd 33 int crc_tab16_init;
MAA 4:c70ef089a3fd 34 unsigned short crc_tab16[256];
MAA 0:b3313c5ffca3 35
MAA 0:b3313c5ffca3 36 };