Bmag incl gps rettelse

Dependencies:   mbed WDT MODSERIAL BME280

SPS/SPS.h

Committer:
MAA
Date:
2017-03-02
Revision:
4:c70ef089a3fd
Parent:
2:39c4a85dc2a4
Child:
5:11782a2008c2

File content as of revision 4:c70ef089a3fd:

#include <string>

#define LINESTART '>'
#define LINESTOP '<' 
#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);
    
    //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;
    int crc_tab16_init;              
    unsigned short crc_tab16[256];  
                     
};