cec-client: fixed entering bootloader mode
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index df295e5033aa59e05bc09b7229ba50755c7884fa..3b8d2a39275c4f847f7da6cfe7f03dfc6ca18be1 100644 (file)
@@ -426,6 +426,9 @@ bool CUSBCECAdapterCommunication::CheckAdapter(uint32_t iTimeoutMs /* = CEC_DEFA
   else
     bReturn = true;
 
+  /* try to read the build date */
+  m_commands->RequestBuildDate();
+
   SetInitialised(bReturn);
   return bReturn;
 }
@@ -455,7 +458,12 @@ bool CUSBCECAdapterCommunication::IsInitialised(void)
 
 bool CUSBCECAdapterCommunication::StartBootloader(void)
 {
-  return m_port->IsOpen() ? m_commands->StartBootloader() : false;
+  if (m_port->IsOpen() && m_commands->StartBootloader())
+  {
+    Close();
+    return true;
+  }
+  return false;
 }
 
 bool CUSBCECAdapterCommunication::SetAckMask(uint16_t iMask)