bool MySensorsSerial::StartHardware() { LoadDevicesFromDatabase(); //return OpenSerialDevice(); //somehow retry does not seem to work?! m_retrycntr = RETRY_DELAY; //will force reconnect first thing //Start worker thread m_thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&MySensorsSerial::Do_Work, this))); StartSendQueue(); return (m_thread != NULL); }
bool MySensorsTCP::StartHardware() { LoadDevicesFromDatabase(); m_stoprequested=false; m_bDoRestart=false; //force connect the next first time m_retrycntr=RETRY_DELAY; m_bIsStarted=true; //Start worker thread m_thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&MySensorsTCP::Do_Work, this))); StartSendQueue(); return (m_thread!=NULL); }