truma_inetbox: implement master mode auto-discovery and device scanning

udp_lin_receiver: add option to suppress repeated identical messages
This commit is contained in:
2025-09-14 21:07:18 +02:00
parent aa5a85ec42
commit 98ad6caab9
3 changed files with 41 additions and 4 deletions

View File

@@ -30,6 +30,14 @@ void TrumaiNetBoxApp::update() {
this->heater_.update();
this->timer_.update();
// Master mode auto-discovery (start device discovery once)
if (this->master_mode_ && !this->master_discovery_started_) {
this->master_discovery_started_ = true;
// Start device discovery for typical Truma heater NAD range
this->master_scan_b2(0x7F, 0x00, 0xFF); // Broadcast scan, full identifier range
ESP_LOGI(TAG, "Master mode: Started automatic device discovery");
}
// Master TX scheduler (throttle to ~20ms spacing)
if (this->master_mode_ && !this->master_tx_queue_.empty()) {
uint32_t now = micros();

View File

@@ -93,6 +93,7 @@ class TrumaiNetBoxApp : public LinBusProtocol {
struct MasterReq { uint8_t pid; uint8_t len; uint8_t data[9]; };
std::queue<MasterReq> master_tx_queue_;
uint32_t last_master_send_us_ = 0;
bool master_discovery_started_ = false;
};