From f2a845d4624b317979f44f823dc964583759fbd8 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 14 Oct 2023 11:59:34 +0200 Subject: [PATCH] fix initial broadcast scan message --- contrib/etc/ebusd/broadcast.csv | 3 +-- src/ebusd/mainloop.cpp | 20 ++++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/contrib/etc/ebusd/broadcast.csv b/contrib/etc/ebusd/broadcast.csv index c14d0a6e7..faef2cf1e 100644 --- a/contrib/etc/ebusd/broadcast.csv +++ b/contrib/etc/ebusd/broadcast.csv @@ -4,8 +4,7 @@ *w,broadcast,,,,FE,,,,,,,,,,,,,,,,,,,,,,,,,, b,,datetime,date/time,,,0700,,outsidetemp,,D2B,,,°C,time,,BTI,,,,date,,BDA,,,,,,,,, r;b,,id,identification,,,0704,,manufacturer,,UCH,0x06=Dungs;0x0f=FH Ostfalia;0x10=TEM;0x11=Lamberti;0x14=CEB;0x15=Landis-Staefa;0x16=FERRO;0x17=MONDIAL;0x18=Wikon;0x19=Wolf;0x20=RAWE;0x30=Satronic;0x40=ENCON;0x50=Kromschröder;0x60=Eberle;0x65=EBV;0x75=Grässlin;0x85=ebm-papst;0x95=SIG;0xa5=Theben;0xa7=Thermowatt;0xb5=Vaillant;0xc0=Toby;0xc5=Weishaupt;0xfd=ebusd.eu,,device manufacturer,id,,STR:5,,,device id,software,,PIN,,,software version,hardware,,PIN,,,hardware version -w,,id,identification,,FE,0704,,,,,,,,,,,,,,,,,,,,,,,,, -w,,queryexistence,Inquiry of existence,,FE,07FE,,,,,,,,,,,,,,,,,,,,,,,,, +w,,queryexistence,Inquiry of existence,,,07FE,,,,,,,,,,,,,,,,,,,,,,,,, b,,signoflife,sign of life,,,07FF,,,,,,,,,,,,,,,,,,,,,,,,, b,,error,error message,,,FE01,,error,,STR:10,,,,,,,,,,,,,,,,,,,,, b,,netresetstate,reset network start,,,FF00,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/src/ebusd/mainloop.cpp b/src/ebusd/mainloop.cpp index e820e31d8..902a65407 100644 --- a/src/ebusd/mainloop.cpp +++ b/src/ebusd/mainloop.cpp @@ -282,18 +282,14 @@ void MainLoop::run() { } } else if (m_initialScan == BROADCAST) { logNotice(lf_main, "starting initial broadcast scan"); - Message* message = m_messages->getScanMessage(BROADCAST); - if (message) { - MasterSymbolString master; - SlaveSymbolString slave; - istringstream input; - result = message->prepareMaster(0, m_address, SYN, UI_FIELD_SEPARATOR, &input, &master); - if (result == RESULT_OK) { - result = m_protocol->sendAndWait(master, &slave); - } - } else { - result = RESULT_ERR_NOTFOUND; - } + MasterSymbolString master; + SlaveSymbolString slave; + master.push_back(m_address); + master.push_back(BROADCAST); + master.push_back(0x07); + master.push_back(0xfe); // query existance message + master.adjustHeader(); + result = m_protocol->sendAndWait(master, &slave); } else { logNotice(lf_main, "starting initial scan for %2.2x", m_initialScan); result = m_busHandler->scanAndWait(m_initialScan, true);