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
s_mainLoop = new MainLoop(s_opt, device, s_messageMap, s_scanHelper, s_requestQueue);
BusHandler* busHandler = s_mainLoop->getBusHandler();
if (s_opt.injectMessages) {
BusHandler* busHandler = s_mainLoop->getBusHandler();
int scanAdrCount = 0;
bool scanAddresses[256] = {};
while (arg_index < argc) {
@@ -420,6 +420,7 @@ int main(int argc, char* argv[], char* envp[]) {
scanAdrCount++;
}
}
busHandler->getProtocol()->start("bushandler");
for (symbol_t address = 0; scanAdrCount > 0; address++) {
if (scanAddresses[address]) {
scanAdrCount--;
@@ -430,6 +431,8 @@ int main(int argc, char* argv[], char* envp[]) {
shutdown();
return 0;
}
} else {
busHandler->getProtocol()->start("bushandler");
}
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,
config, opt.pollInterval);
m_protocol = m_busHandler->getProtocol();
m_protocol->start("bushandler");
// create network
m_htmlPath = opt.htmlPath;
-1
View File
@@ -245,7 +245,6 @@ class ProtocolHandler : public WaitThread {
* Destructor.
*/
virtual ~ProtocolHandler() {
stop();
join();
BusRequest* req;
while ((req = m_finishedRequests.pop()) != nullptr) {