MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / StartBootloader

Method StartBootloader

src/libcec/CECProcessor.cpp:626–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624}
625
626bool CCECProcessor::StartBootloader(const char *strPort /* = NULL */)
627{
628 bool bReturn(false);
629 // open a connection if no connection has been opened
630 if (!m_communication && strPort)
631 {
632 CAdapterFactory factory(this->m_libcec);
633 IAdapterCommunication *comm = factory.GetInstance(strPort);
634 CTimeout timeout(CEC_DEFAULT_CONNECT_TIMEOUT);
635 int iConnectTry(0);
636 while (timeout.TimeLeft() > 0 && (bReturn = comm->Open(timeout.TimeLeft() / CEC_CONNECT_TRIES, true)) == false)
637 {
638 m_libcec->AddLog(CEC_LOG_ERROR, "could not open a connection (try %d)", ++iConnectTry);
639 comm->Close();
640 Sleep(CEC_DEFAULT_TRANSMIT_RETRY_WAIT);
641 }
642 if (comm->IsOpen())
643 {
644 bReturn = comm->StartBootloader();
645 SAFE_DELETE(comm);
646 }
647 return bReturn;
648 }
649 else
650 {
651 m_communication->StartBootloader();
652 Close();
653 bReturn = true;
654 }
655
656 return bReturn;
657}
658
659bool CCECProcessor::PingAdapter(void)
660{

Callers

nothing calls this directly

Calls 6

CloseFunction · 0.85
GetInstanceMethod · 0.80
OpenMethod · 0.45
AddLogMethod · 0.45
CloseMethod · 0.45
IsOpenMethod · 0.45

Tested by

no test coverage detected