103 static std::string
header() {
return "loadTimestamp,weight\n"; }
216 uint8_t checksum = 0;
222 for (
unsigned int i = 0; i < str.length(); i++)
225 sprintf(
ck,
"%x", checksum);
This file includes all the types the logdecoder script will decode.
ReturnsStates
Structure of the errors in the ASCII requests.
LoadCellModes
Enumeration of all the modes supported by the driver.
LoadCellValuesEnum
Enumeration of all the requests in ASCII mode.
std::map< const LoadCellValuesEnum, std::string > LoadCellValues
Type that maps the different requests to their keyword.
Structure that contains all the parameters for the request to be sent.
std::string to_string()
Transforms the request into a string to be sent over serial.
void setChecksum()
In base of the address and the request parameter calculates the checksum.
Structure of the output of the load cell in [continuous mode -> ModT].
Structure of the output of the load cell in [continuous mode -> ModTd].
Structure that stores a data value, with his timestamp and his validity.
static std::string header()
MBLoadCellData(float data)
MBLoadCellData(uint64_t loadTimestamp, float data)
void print(std::ostream &os) const
Structure of the output of the load cell in [continuous mode -> ModT].
void updateValue(LoadCellValuesEnum val, float data)
Updates the correct value with the data passed. Also, memorizes the maximum and minimum value of the ...
MBLoadCellData peakWeight
void print() const
Prints the structure in a nice way.