Update payload.h

This commit is contained in:
August Quint 2020-02-03 15:24:07 +01:00 committed by GitHub
parent 6eccb475e3
commit 1ec0f8f3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,62 @@ public:
void addTime(time_t value); void addTime(time_t value);
void addPM10(float value); void addPM10(float value);
void addPM25(float value); void addPM25(float value);
private:
void addChars( char* string, int len);
#if (PAYLOAD_ENCODER == 1) // format plain
private:
uint8_t *buffer;
uint8_t cursor;
#elif (PAYLOAD_ENCODER == 2) // format packed
private:
uint8_t *buffer;
uint8_t cursor;
void uintToBytes(uint64_t i, uint8_t byteSize);
void writeUptime(uint64_t unixtime);
void writeLatLng(double latitude, double longitude);
void writeUint64(uint64_t i);
void writeUint32(uint32_t i);
void writeUint16(uint16_t i);
void writeUint8(uint8_t i);
void writeFloat(float value);
void writeUFloat(float value);
void writePressure(float value);
void writeVersion(char *version);
void writeBitmap(bool a, bool b, bool c, bool d, bool e, bool f, bool g,
bool h);
#elif ((PAYLOAD_ENCODER == 3) || (PAYLOAD_ENCODER == 4)) // format cayenne lpp
private:
uint8_t *buffer;
uint8_t maxsize;
uint8_t cursor;
#else
#error No valid payload converter defined!
#endif
};
extern PayloadConvert payload;
#endif // _PAYLOAD_H_
void addCount(uint16_t value, uint8_t sniffytpe);
void addConfig(configData_t value);
void addStatus(uint16_t voltage, uint64_t uptime, float cputemp, uint32_t mem,
uint8_t reset1, uint8_t reset2);
void addAlarm(int8_t rssi, uint8_t message);
void addVoltage(uint16_t value);
void addGPS(gpsStatus_t value);
void addBME(bmeStatus_t value);
void addButton(uint8_t value);
void addSensor(uint8_t[]);
void addTime(time_t value);
void addPM10(float value);
void addPM25(float value);
void addChars( char* string, int len); void addChars( char* string, int len);
#if (PAYLOAD_ENCODER == 1) // format plain #if (PAYLOAD_ENCODER == 1) // format plain