mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-11 02:09:57 +03:00
fix fluctuating bitvalues, fix "send telegram", add solarpump softstart, add DHW temp for 9000i
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user