From: Lars Op den Kamp Date: Tue, 24 Apr 2012 20:30:41 +0000 (+0200) Subject: cec: removed no longer used CCECBusScan X-Git-Tag: upstream/2.2.0~1^2~29^2^2~45 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=765681fcfcf940773e7a255a342c06c00352fb10;hp=b47f66afc453fb3fdbad051aceb44941a49965ba;p=deb_libcec.git cec: removed no longer used CCECBusScan --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 9cf771b..9f0274b 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -1476,51 +1476,6 @@ const char *CCECProcessor::ToString(const cec_server_version version) } } -void *CCECBusScan::Process(void) -{ - CCECBusDevice *device(NULL); - uint8_t iCounter(0); - - while (!IsStopped()) - { - if (++iCounter < 10) - { - Sleep(1000); - continue; - } - for (unsigned int iPtr = 0; iPtr <= 11 && !IsStopped(); iPtr++) - { - device = m_processor->m_busDevices[iPtr]; - WaitUntilIdle(); - if (device && device->GetStatus(true) == CEC_DEVICE_STATUS_PRESENT) - { - WaitUntilIdle(); - if (!IsStopped()) - device->GetVendorId(); - - WaitUntilIdle(); - if (!IsStopped()) - device->GetPowerStatus(true); - } - } - } - - return NULL; -} - -void CCECBusScan::WaitUntilIdle(void) -{ - if (IsStopped()) - return; - - int32_t iWaitTime = 3000 - (int32_t)(GetTimeMs() - m_processor->GetLastTransmission()); - while (iWaitTime > 0) - { - Sleep(iWaitTime); - iWaitTime = 3000 - (int32_t)(GetTimeMs() - m_processor->GetLastTransmission()); - } -} - bool CCECProcessor::StartBootloader(const char *strPort /* = NULL */) { if (!m_communication && strPort) diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index 3bb56fd..ce59098 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -231,17 +231,4 @@ namespace CEC CCECInputBuffer m_inBuffer; libcec_configuration m_configuration; }; - - class CCECBusScan : public PLATFORM::CThread - { - public: - CCECBusScan(CCECProcessor *processor) { m_processor = processor; } - virtual ~CCECBusScan(void) { StopThread(true); } - virtual void *Process(void); - - private: - void WaitUntilIdle(void); - - CCECProcessor *m_processor; - }; };