コード例 #1
0
ファイル: MySensorsSerial.cpp プロジェクト: nayrnet/domoticz
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);
}
コード例 #2
0
ファイル: MySensorsTCP.cpp プロジェクト: AbsolutK/domoticz
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);
}