Bmag incl gps rettelse

Dependencies:   mbed WDT MODSERIAL BME280

Embed: (wiki syntax)

« Back to documentation index

SPS Class Reference

SPS Class Reference

An *.SPS format handler class. More...

#include <SPS.h>

Public Member Functions

 SPS ()
 SPS, class default constructor.
void UpdateCurrentString (string tag, string identifier_id, string group_id, string date, string time, string ZZZ, string encoding, string source_id, string interpreter_id, string data_line_version, string source_firmware_version, string interpreter_firmware_version, string barcode, string latitude, string longitude, bool gpsFixFlag, string batteryvoltage, string preassure, string temperature, string humidity, string altitude, string mag_time, string mag_nt, string mag_sq, Serial *dbg)
 UpdateCurrentString, sps string creation method, taking data and info as parameters.
void UpdateHeaderString (string barcode, string identifier_id, string group_id, string ZZZ, string encoding, string source_id, string interpreter_id, string data_line_version, string source_firmware_version, string interpreter_firmware_version)
 UpdateHeaderString, header / RMRK update method.
void UpdateCurrentErrString (string tag, string identifier_id, string group_id, string date, string time, string ZZZ, string encoding, 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)
 UpdateCurrentErrString, sps ERR string creation method, taking data and info as parameters.
void init_crc16_tab ()
 init_crc16_tab, creates a crc tab.
unsigned short update_crc_16 (unsigned short crc, char c)
 update_crc_16, updates crc tab.
string getCurrentString (void)
 getCurrentString, returns the current sps data string
string getCurrentErrString (void)
 getCurrentErrString, getter method returning current sps error string
string getHeaderString (void)
 getHeaderString, getter method, returning header string for *.sps file
bool getErrStatus (void)
 getErrStatus, returns the current error status flag
void setErrStatus (bool status)
 setErrStatus, sets error status flag
void addToCurrentString (string data)
 addToCurrentString, appends string of data to the sps string currently being manipulated.
void addToCurrentString (char data)
 addToCurrentString, appends char to the sps string currently being manipulated.
void addToCurrentErrString (string data)
 addToCurrentErrString, appends string to the sps err_string currently being manipulated.
void addToCurrentErrString (char data)
 addToCurrentErrString, appends a character to the sps err_string currently being manipulated.
void addToCurrentHeaderString (string data)
 addToCurrentHeaderString, appends string to the current header string
void addToCurrentHeaderString (char data)
 addToCurrentHeaderString, appends char to the current header string
void generateSpsFilename (string formattedDate, string barcode, string time)
 generateSpsFilename, generates a sps file name, including file postfix, using the current date as input.
string getSpsFileName (void)
 getSpsFileName, getter method, returning a *.sps filename based on the formatted date generated using generateSpsFilename(string formattedDate) method.

Detailed Description

An *.SPS format handler class.

This class is used to create and handle creation of *.sps strings for *.sps files.

Definition at line 19 of file SPS.h.


Constructor & Destructor Documentation

SPS (  )

SPS, class default constructor.

Initializing different class member values, creating a header string.

Definition at line 7 of file SPS.cpp.


Member Function Documentation

void addToCurrentErrString ( string  data )

addToCurrentErrString, appends string to the sps err_string currently being manipulated.

Parameters:
data,:data string

Definition at line 504 of file SPS.cpp.

void addToCurrentErrString ( char  data )

addToCurrentErrString, appends a character to the sps err_string currently being manipulated.

Parameters:
data,:data char

Definition at line 519 of file SPS.cpp.

void addToCurrentHeaderString ( char  data )

addToCurrentHeaderString, appends char to the current header string

Parameters:
data,:data char

Definition at line 495 of file SPS.cpp.

void addToCurrentHeaderString ( string  data )

addToCurrentHeaderString, appends string to the current header string

Parameters:
data,:data string

Definition at line 471 of file SPS.cpp.

void addToCurrentString ( char  data )

addToCurrentString, appends char to the sps string currently being manipulated.

Parameters:
data,:data character

Definition at line 460 of file SPS.cpp.

void addToCurrentString ( string  data )

addToCurrentString, appends string of data to the sps string currently being manipulated.

Parameters:
data,:string containing data

Definition at line 437 of file SPS.cpp.

void generateSpsFilename ( string  formattedDate,
string  barcode,
string  time 
)

generateSpsFilename, generates a sps file name, including file postfix, using the current date as input.

Parameters:
formattedDate,:Date string using a formatted date with format: "YYYY/MM/DD"
barcode,:Char array with barcode serial number in ASCII
time,:String containing a timestamp formatted "HH:MM:SS.FFF"

Definition at line 531 of file SPS.cpp.

string getCurrentErrString ( void   )

getCurrentErrString, getter method returning current sps error string

Returns:
currentErrString: returns the current sps error string.

Definition at line 584 of file SPS.cpp.

string getCurrentString ( void   )

getCurrentString, returns the current sps data string

Returns:
returns current sps data string

Definition at line 403 of file SPS.cpp.

bool getErrStatus ( void   )

getErrStatus, returns the current error status flag

Returns:
returns the current error status flag (bool)

Definition at line 412 of file SPS.cpp.

string getHeaderString ( void   )

getHeaderString, getter method, returning header string for *.sps file

Returns:
returns the header string for the *.sps file

Definition at line 428 of file SPS.cpp.

string getSpsFileName ( void   )

getSpsFileName, getter method, returning a *.sps filename based on the formatted date generated using generateSpsFilename(string formattedDate) method.

Returns:
fileNameString returns file name including postfix.

Definition at line 574 of file SPS.cpp.

void init_crc16_tab (  )

init_crc16_tab, creates a crc tab.

Populates a crc array for later use

Definition at line 349 of file SPS.cpp.

void setErrStatus ( bool  status )

setErrStatus, sets error status flag

Parameters:
status,:boolean value assigned to errorStatus

Definition at line 420 of file SPS.cpp.

unsigned short update_crc_16 ( unsigned short  crc,
char  c 
)

update_crc_16, updates crc tab.

Parameters:
crc,:the crc currently getting calculated
c,:next character to be part of crc
Returns:
returns crc value

Definition at line 381 of file SPS.cpp.

void UpdateCurrentErrString ( string  tag,
string  identifier_id,
string  group_id,
string  date,
string  time,
string  ZZZ,
string  encoding,
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 
)

UpdateCurrentErrString, sps ERR string creation method, taking data and info as parameters.

Generates the current sps ERR string containing everything needed in a BMAG sps string including crc, brackets etc.

Parameters:
tag,:string containing the tag for the sps logging unit eg. "BMAG"
identifier_id,:string containing the identifier id of the unit.
group_id,:string containing the group id of the unit.
date,:string containing the date in the format "YYYY/MM/DD"
time,:string containing the current time in format "HH:MM:SS.FFF"
ZZZ,:string containing "ZZZ" :)
encoding,:string containing encoding as described in the *.sps documentation
source_id,:string containing the source id of the unit eg. "0000"
interpreter_id,:string containing the interpreter id of the unit eg. "00"
data_line_version,:string containing data line version as described in the *.sps documentation, eg. "01"
source_firmware_version,:string containing the firmware version of the unit eg. "1.2"
barcode,:string containing the barcode of the unit, eg. "12345"
latitude,:string containing the latitude of the unit in decimal degrees. For further info read the *.sps documentation.
longitude,:string containing the longitude of the unit in decimal degrees. For further info read the *.sps documentation.
gpsFixFlag,:bool containing the gps fix status, 1 if gps fix is present, else 0.
mag_time,:string containing the last timestamp received from GSM-19 device eg. "000048.0"
mag_nt,:string containing the last mag measurement in nT eg. "036418.77"
mag_sq,:string containing info about the measurement quality of the last mag measurement eg. "99"

Definition at line 278 of file SPS.cpp.

void UpdateCurrentString ( string  tag,
string  identifier_id,
string  group_id,
string  date,
string  time,
string  ZZZ,
string  encoding,
string  source_id,
string  interpreter_id,
string  data_line_version,
string  source_firmware_version,
string  interpreter_firmware_version,
string  barcode,
string  latitude,
string  longitude,
bool  gpsFixFlag,
string  batteryvoltage,
string  preassure,
string  temperature,
string  humidity,
string  altitude,
string  mag_time,
string  mag_nt,
string  mag_sq,
Serial *  dbg 
)

UpdateCurrentString, sps string creation method, taking data and info as parameters.

Generates an sps string containing everything needed in a BMAG sps string including crc, brackets etc.

Parameters:
tag,:string containing the tag for the sps logging unit eg. "BMAG"
identifier_id,:string containing the identifier id of the unit.
group_id,:string containing the group id of the unit.
date,:string containing the date in the format "YYYY/MM/DD"
time,:string containing the current time in format "HH:MM:SS.FFF"
ZZZ,:string containing "ZZZ" :)
encoding,:string containing encoding as described in the *.sps documentation
source_id,:string containing the source id of the unit eg. "0000"
interpreter_id,:string containing the interpreter id of the unit eg. "00"
data_line_version,:string containing data line version as described in the *.sps documentation, eg. "01"
source_firmware_version,:string containing the firmware version of the unit eg. "1.2"
barcode,:string containing the barcode of the unit, eg. "12345"
latitude,:string containing the latitude of the unit in decimal degrees. For further info read the *.sps documentation.
longitude,:string containing the longitude of the unit in decimal degrees. For further info read the *.sps documentation.
gpsFixFlag,:bool containing the gps fix status, 1 if gps fix is present, else 0.
batteryvoltage,:string containing the battery voltage of the units battery pack, eg. "14.2"
preassure,:string containing preassure measurement in hPa
temperature,:string containing temperature measured in deg C
humidity,:string containing air humidity percentage
mag_time,:string containing the last timestamp received from GSM-19 device eg. "000048.0"
mag_nt,:string containing the last mag measurement in nT eg. "036418.77"
mag_sq,:string containing info about the measurement quality of the last mag measurement eg. "99"

Definition at line 49 of file SPS.cpp.

void UpdateHeaderString ( string  barcode,
string  identifier_id,
string  group_id,
string  ZZZ,
string  encoding,
string  source_id,
string  interpreter_id,
string  data_line_version,
string  source_firmware_version,
string  interpreter_firmware_version 
)

UpdateHeaderString, header / RMRK update method.

Updates header / RMRK string

Parameters:
identifier_id,:string containing the identifier id of the unit.
group_id,:string containing the group id of the unit.
ZZZ,:string containing "ZZZ" :)
encoding,:string containing encoding as described in the *.sps documentation
source_id,:string containing the source id of the unit eg. "0000"
interpreter_id,:string containing the interpreter id of the unit eg. "00"
data_line_version,:string containing data line version as described in the *.sps documentation, eg. "01"
source_firmware_version,:string containing the firmware version of the unit eg. "1.2"
barcode,:string containing the barcode of the unit, eg. "12345"
interpreter_firmware_version,:string containing interpreter firmware version

Definition at line 170 of file SPS.cpp.