Bmag incl gps rettelse
Dependencies: mbed WDT MODSERIAL BME280
Diff: SPS/SPS.h
- Revision:
- 4:c70ef089a3fd
- Parent:
- 2:39c4a85dc2a4
- Child:
- 5:11782a2008c2
diff -r 38eabaa92552 -r c70ef089a3fd SPS/SPS.h --- a/SPS/SPS.h Thu Feb 23 14:54:35 2017 +0000 +++ b/SPS/SPS.h Thu Mar 02 14:04:56 2017 +0000 @@ -5,19 +5,32 @@ #define HEADEREND '|' #define SPACE ' ' +#define P_16 0xA001 + using std::string; class SPS{ public: //default constructor SPS(); - + + + //Updates current string 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); - string checkSumCalc(void); + //Fills the array for calculation of the CRC-16 with values + void init_crc16_tab(); + // The function update_crc_16 calculates a new CRC-16 value based on the + // previous value of the CRC and the next byte of the data to be checked. + unsigned short update_crc_16(unsigned short crc, char c) + + +private: string currentString; string currentErrString; - string headerString; + string headerString; + int crc_tab16_init; + unsigned short crc_tab16[256]; };