Пример #1
0
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
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);
}