Bmag incl gps rettelse
Dependencies: mbed WDT MODSERIAL BME280
SPS/SPS.h@7:872984a67d5b, 2017-03-15 (annotated)
- Committer:
- MAA
- Date:
- Wed Mar 15 13:56:53 2017 +0000
- Revision:
- 7:872984a67d5b
- Parent:
- 6:6d1683c8b26b
- Child:
- 8:d6287c33b54a
ERR og ERRS tilf?jet til SPS klassen.; ; Filnavn?ndring ved dato?ndring i GPRMC streng tilf?jet.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MAA | 2:39c4a85dc2a4 | 1 | #include <string> |
MAA | 5:11782a2008c2 | 2 | #include "mbed.h" |
MAA | 2:39c4a85dc2a4 | 3 | |
MAA | 0:b3313c5ffca3 | 4 | #define LINESTART '>' |
MAA | 0:b3313c5ffca3 | 5 | #define LINESTOP '<' |
MAA | 0:b3313c5ffca3 | 6 | #define HEADEREND '|' |
MAA | 0:b3313c5ffca3 | 7 | #define SPACE ' ' |
MAA | 0:b3313c5ffca3 | 8 | |
MAA | 4:c70ef089a3fd | 9 | #define P_16 0xA001 |
MAA | 4:c70ef089a3fd | 10 | |
MAA | 2:39c4a85dc2a4 | 11 | using std::string; |
MAA | 2:39c4a85dc2a4 | 12 | |
MAA | 0:b3313c5ffca3 | 13 | class SPS{ |
MAA | 0:b3313c5ffca3 | 14 | public: |
MAA | 0:b3313c5ffca3 | 15 | //default constructor |
MAA | 0:b3313c5ffca3 | 16 | SPS(); |
MAA | 4:c70ef089a3fd | 17 | |
MAA | 4:c70ef089a3fd | 18 | //Updates current string |
MAA | 5:11782a2008c2 | 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 source_firmware_version, string interpreter_firmware_version, string latitude, string longitude, bool gpsFixFlag, string mag_time, string mag_nt, string mag_sq, Serial * dbg); |
MAA | 7:872984a67d5b | 20 | |
MAA | 7:872984a67d5b | 21 | //Updates current ERR |
MAA | 7:872984a67d5b | 22 | void UpdateCurrentErrString(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 source_firmware_version, string interpreter_firmware_version, string latitude, string longitude, bool gpsFixFlag, string mag_time, string mag_nt, string mag_sq, Serial * dbg); |
MAA | 2:39c4a85dc2a4 | 23 | |
MAA | 4:c70ef089a3fd | 24 | //Fills the array for calculation of the CRC-16 with values |
MAA | 4:c70ef089a3fd | 25 | void init_crc16_tab(); |
MAA | 2:39c4a85dc2a4 | 26 | |
MAA | 5:11782a2008c2 | 27 | //The function update_crc_16 calculates a new CRC-16 value based on the |
MAA | 5:11782a2008c2 | 28 | //previous value of the CRC and the next byte of the data to be checked. |
MAA | 5:11782a2008c2 | 29 | unsigned short update_crc_16(unsigned short crc, char c); |
MAA | 5:11782a2008c2 | 30 | |
MAA | 5:11782a2008c2 | 31 | //Gets / returns current sps data string |
MAA | 5:11782a2008c2 | 32 | string getCurrentString(void); |
MAA | 5:11782a2008c2 | 33 | |
MAA | 7:872984a67d5b | 34 | //Gets / returns current sps err string |
MAA | 7:872984a67d5b | 35 | string getCurrentErrString(void); |
MAA | 7:872984a67d5b | 36 | |
MAA | 5:11782a2008c2 | 37 | //get headerstring |
MAA | 5:11782a2008c2 | 38 | string getHeaderString(void); |
MAA | 4:c70ef089a3fd | 39 | |
MAA | 5:11782a2008c2 | 40 | //Get error status |
MAA | 5:11782a2008c2 | 41 | bool getErrStatus(void); |
MAA | 4:c70ef089a3fd | 42 | |
MAA | 5:11782a2008c2 | 43 | //set Error status |
MAA | 5:11782a2008c2 | 44 | void setErrStatus(bool status); |
MAA | 5:11782a2008c2 | 45 | |
MAA | 5:11782a2008c2 | 46 | //add data to current string |
MAA | 5:11782a2008c2 | 47 | void addToCurrentString(string data); |
MAA | 5:11782a2008c2 | 48 | void addToCurrentString(char data); |
MAA | 6:6d1683c8b26b | 49 | |
MAA | 7:872984a67d5b | 50 | //add data to current Errstring |
MAA | 7:872984a67d5b | 51 | void addToCurrentErrString(string data); |
MAA | 7:872984a67d5b | 52 | void addToCurrentErrString(char data); |
MAA | 7:872984a67d5b | 53 | |
MAA | 6:6d1683c8b26b | 54 | //generate sps filename |
MAA | 6:6d1683c8b26b | 55 | void generateSpsFilename(string formattedDate); |
MAA | 6:6d1683c8b26b | 56 | |
MAA | 6:6d1683c8b26b | 57 | //get sps filename |
MAA | 6:6d1683c8b26b | 58 | string getSpsFileName(void); |
MAA | 5:11782a2008c2 | 59 | |
MAA | 6:6d1683c8b26b | 60 | private: |
MAA | 6:6d1683c8b26b | 61 | string fileNameString; |
MAA | 2:39c4a85dc2a4 | 62 | string currentString; |
MAA | 6:6d1683c8b26b | 63 | string lastString; |
MAA | 2:39c4a85dc2a4 | 64 | string currentErrString; |
MAA | 4:c70ef089a3fd | 65 | string headerString; |
MAA | 5:11782a2008c2 | 66 | bool errStatus; |
MAA | 4:c70ef089a3fd | 67 | int crc_tab16_init; |
MAA | 4:c70ef089a3fd | 68 | unsigned short crc_tab16[256]; |
MAA | 0:b3313c5ffca3 | 69 | |
MAA | 0:b3313c5ffca3 | 70 | }; |