Update payload.cpp

This commit is contained in:
August Quint 2020-03-13 15:29:20 +01:00 committed by GitHub
parent 8520afcf8d
commit 0c91c55cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -510,38 +510,6 @@ void PayloadConvert::addTime(time_t value) {
}
#endif // PAYLOAD_ENCODER
void PayloadConvert::addPM10( float value) {
#if (HAS_SDS011)
#if (PAYLOAD_ENCODER == 1) // plain
char tempBuffer[10+1];
sprintf( tempBuffer, ",%5.1f", value);
addChars(tempBuffer, strlen(tempBuffer));
#elif (PAYLOAD_ENCODER == 2 ) // packed
writeUint16( (uint16_t) (value*10) );
#elif (PAYLOAD_ENCODER == 3 ) // Cayenne LPP dynamic
#error not implemented yet
#elif (PAYLOAD_ENCODER == 4 ) // Cayenne LPP packed
#error not implemented yet
#endif
#endif // HAS_SDS011
}
void PayloadConvert::addPM25( float value) {
#if (HAS_SDS011)
#if (PAYLOAD_ENCODER == 1) // plain
char tempBuffer[10+1];
sprintf( tempBuffer, ",%5.1f", value);
addChars(tempBuffer, strlen(tempBuffer));
#elif (PAYLOAD_ENCODER == 2 ) // packed
writeUint16( (uint16_t) (value*10) );
#elif (PAYLOAD_ENCODER == 3 ) // Cayenne LPP dynamic
#error not implemented yet
#elif (PAYLOAD_ENCODER == 4 ) // Cayenne LPP packed
#error not implemented yet
#endif
#endif // HAS_SDS011
}
void PayloadConvert::addChars( char * string, int len) {
for (int i=0; i < len; i++)
addByte(string[i]);