fix fluctuating bitvalues, fix "send telegram", add solarpump softstart, add DHW temp for 9000i

This commit is contained in:
MichaelDvP
2020-06-23 13:15:56 +02:00
parent 1e97ced1a7
commit 1c73af88d2
4 changed files with 22 additions and 5 deletions

View File

@@ -81,11 +81,12 @@ class Telegram {
// reads a bit value from a given telegram position
void read_bitvalue(uint8_t & value, const uint8_t index, const uint8_t bit) const {
if ((index - offset) >= message_length) {
uint8_t abs_index = (index - offset);
if(abs_index >= message_length) {
return; // out of bounds
}
value = (uint8_t)(((message_data[index - offset]) >> (bit)) & 0x01);
value = (uint8_t)(((message_data[abs_index]) >> (bit)) & 0x01);
}
// read values from a telegram. We always store the value, regardless if its garbage