bool CLogitechMediaServer::StopHardware() { StopHeartbeatThread(); try { if (m_thread) { m_stoprequested = true; m_thread->join(); m_thread.reset(); //Make sure all our background workers are stopped int iRetryCounter = 0; while ((m_iThreadsRunning > 0) && (iRetryCounter<15)) { sleep_milliseconds(500); iRetryCounter++; } } } catch (...) { //Don't throw from a Stop command } m_bIsStarted = false; return true; }
bool CTeleinfoSerial::StopHardware() { terminate(); StopHeartbeatThread(); m_bIsStarted = false; return true; }
bool SolarEdgeTCP::StopHardware() { m_bIsStarted=false; m_stoprequested=true; if (m_pTCPProxy==NULL) return true; m_pTCPProxy->stop(); delete m_pTCPProxy; m_pTCPProxy=NULL; StopHeartbeatThread(); return true; }
bool C1Wire::StopHardware() { if (m_thread) { m_stoprequested = true; m_thread->join(); } m_bIsStarted=false; if (m_system) { delete m_system; m_system=NULL; } StopHeartbeatThread(); return true; }
bool Teleinfo::StopHardware() { if (isOpen()) { try { clearReadCallback(); close(); } catch(...) { //Don't throw from a Stop command } } StopHeartbeatThread(); m_bIsStarted=false; return true; }
bool S0MeterSerial::StopHardware() { m_bIsStarted=false; if (isOpen()) { try { clearReadCallback(); close(); doClose(); setErrorStatus(true); } catch(...) { //Don't throw from a Stop command } } StopHeartbeatThread(); return true; }
bool CPanasonic::StopHardware() { StopHeartbeatThread(); try { if (m_thread) { m_stoprequested = true; m_thread->join(); m_thread.reset(); } } catch (...) { //Don't throw from a Stop command } m_bIsStarted = false; return true; }
bool MQTT::StopHardware() { StopHeartbeatThread(); m_stoprequested=true; try { if (m_thread) { m_thread->join(); m_thread.reset(); } } catch (...) { //Don't throw from a Stop command } if (m_sConnection.connected()) m_sConnection.disconnect(); m_IsConnected = false; return true; }
bool CGpio::StopHardware() { m_stoprequested=true; if (m_thread_poller != NULL) m_thread_poller->join(); boost::mutex::scoped_lock lock(m_pins_mutex); for(std::vector<CGpioPin>::iterator it = pins.begin(); it != pins.end(); ++it) { if (m_thread_interrupt[it->GetPin()] != NULL) m_thread_interrupt[it->GetPin()]->join(); } for(std::vector<CGpioPin>::iterator it = pins.begin(); it != pins.end(); ++it) if (it->GetReadValueFd() != -1) close(it->GetReadValueFd()); pins.clear(); m_bIsStarted=false; StopHeartbeatThread(); _log.Log(LOG_NORM, "GPIO: Hardware stopped"); return true; }