fix startup

This commit is contained in:
John
2023-10-14 07:49:10 +02:00
parent dc78076fbc
commit 8b302de3ac
4 changed files with 5 additions and 5 deletions
+4 -1
View File
@@ -401,8 +401,8 @@ int main(int argc, char* argv[], char* envp[]) {
// create the MainLoop and start it // create the MainLoop and start it
s_mainLoop = new MainLoop(s_opt, device, s_messageMap, s_scanHelper, s_requestQueue); s_mainLoop = new MainLoop(s_opt, device, s_messageMap, s_scanHelper, s_requestQueue);
BusHandler* busHandler = s_mainLoop->getBusHandler();
if (s_opt.injectMessages) { if (s_opt.injectMessages) {
BusHandler* busHandler = s_mainLoop->getBusHandler();
int scanAdrCount = 0; int scanAdrCount = 0;
bool scanAddresses[256] = {}; bool scanAddresses[256] = {};
while (arg_index < argc) { while (arg_index < argc) {
@@ -420,6 +420,7 @@ int main(int argc, char* argv[], char* envp[]) {
scanAdrCount++; scanAdrCount++;
} }
} }
busHandler->getProtocol()->start("bushandler");
for (symbol_t address = 0; scanAdrCount > 0; address++) { for (symbol_t address = 0; scanAdrCount > 0; address++) {
if (scanAddresses[address]) { if (scanAddresses[address]) {
scanAdrCount--; scanAdrCount--;
@@ -430,6 +431,8 @@ int main(int argc, char* argv[], char* envp[]) {
shutdown(); shutdown();
return 0; return 0;
} }
} else {
busHandler->getProtocol()->start("bushandler");
} }
s_mainLoop->start("mainloop"); s_mainLoop->start("mainloop");
-1
View File
@@ -164,7 +164,6 @@ MainLoop::MainLoop(const struct options& opt, Device *device, MessageMap* messag
m_busHandler = new BusHandler(m_device, m_messages, scanHelper, m_busHandler = new BusHandler(m_device, m_messages, scanHelper,
config, opt.pollInterval); config, opt.pollInterval);
m_protocol = m_busHandler->getProtocol(); m_protocol = m_busHandler->getProtocol();
m_protocol->start("bushandler");
// create network // create network
m_htmlPath = opt.htmlPath; m_htmlPath = opt.htmlPath;
-1
View File
@@ -245,7 +245,6 @@ class ProtocolHandler : public WaitThread {
* Destructor. * Destructor.
*/ */
virtual ~ProtocolHandler() { virtual ~ProtocolHandler() {
stop();
join(); join();
BusRequest* req; BusRequest* req;
while ((req = m_finishedRequests.pop()) != nullptr) { while ((req = m_finishedRequests.pop()) != nullptr) {
+1 -2
View File
@@ -247,7 +247,7 @@ elif [[ -n "$1" ]]; then
pid=$(ps -C ebusd -o pid=) pid=$(ps -C ebusd -o pid=)
done done
else else
$ebusd -d tcp:127.0.0.1:8876 --initsend --latency 10 -n -c "$PWD/contrib/etc/ebusd" --pollinterval=10 -s -a 31 --acquireretries 3 --answer --generatesyn --receivetimeout 40000 --sendretries 1 --enablehex --htmlpath "$PWD/contrib/html" --httpport 8878 --pidfile "$PWD/ebusd.pid" --localhost -p 8877 -l "$PWD/ebusd.log" --logareas all --loglevel debug --lograwdata=bytes --lograwdatafile "$PWD/ebusd.raw" --lograwdatasize 1 --dumpfile "$PWD/ebusd.dump" --dumpsize 100 -D --scanconfig --aclfile="$PWD/acl.csv" --mqttport=1883 --enablehex --enabledefine $ebusd -d tcp:127.0.0.1:8876 --initsend --latency 10 -n -c "$PWD/contrib/etc/ebusd" --pollinterval=10 -s --scanretries=0 -a 31 --acquireretries 3 --answer --generatesyn --receivetimeout 40000 --sendretries 1 --enablehex --htmlpath "$PWD/contrib/html" --httpport 8878 --pidfile "$PWD/ebusd.pid" --localhost -p 8877 -l "$PWD/ebusd.log" --logareas all --loglevel debug --lograwdata=bytes --lograwdatafile "$PWD/ebusd.raw" --lograwdatasize 1 --dumpfile "$PWD/ebusd.dump" --dumpsize 100 -D --scanconfig --aclfile="$PWD/acl.csv" --mqttport=1883 --enablehex --enabledefine
sleep 3 sleep 3
pid=`head -n 1 "$PWD/ebusd.pid"` pid=`head -n 1 "$PWD/ebusd.pid"`
fi fi
@@ -359,7 +359,6 @@ decode -V -N UCH 102030
encode UCH,,,,uch 10;1 encode UCH,,,,uch 10;1
raw bytes raw bytes
raw raw
reload
nocommand nocommand
EOF EOF
status=1 status=1