Skip to content

Commit

Permalink
fix initial broadcast scan message
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Oct 14, 2023
1 parent 8646b0d commit f2a845d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
3 changes: 1 addition & 2 deletions contrib/etc/ebusd/broadcast.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,,,,,,,,,,,,,,,,,,,,,,,,,
Expand Down
20 changes: 8 additions & 12 deletions src/ebusd/mainloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f2a845d

Please sign in to comment.