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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user