From ddd21e646af47189c02a749a02616762b73c3c69 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 23 Sep 2024 02:27:54 +0200 Subject: [PATCH] Test --- components/tc_bus/protocol.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/tc_bus/protocol.cpp b/components/tc_bus/protocol.cpp index ac12175..3c879bb 100644 --- a/components/tc_bus/protocol.cpp +++ b/components/tc_bus/protocol.cpp @@ -193,11 +193,16 @@ namespace esphome // 81 0 00000 // select eeprom page of serial number - if(command & 0x800000) // 1 + switch (((command >> 28) & 0xF) & 0x1) { - data.type = COMMAND_TYPE_SELECT_EEPROM_PAGE; - // data.address = (command & 0xF); // page todo - data.serial_number = command & 0xFFFFF; + case 1: + data.type = COMMAND_TYPE_SELECT_EEPROM_PAGE; + + uint32_t thirdNibble = (value >> 24) & 0xF; // Nibble isolieren + data.address = static_cast(thirdNibble); + + data.serial_number = command & 0xFFFFF; + break; } break; }