cec: added PollDevice()/cec_poll_device()
[deb_libcec.git] / src / lib / CECProcessor.cpp
index c83bdc05486d158140313c5a602840f2e0188478..49b3bd2e35a11e5727e0f4c4f850b878999cc440 100644 (file)
@@ -156,7 +156,9 @@ bool CCECProcessor::SetInactiveView(void)
 void CCECProcessor::LogOutput(const cec_command &data)
 {
   CStdString strTx;
-  strTx.Format("<< %02x:%02x", ((uint8_t)data.initiator << 4) + (uint8_t)data.destination, (uint8_t)data.opcode);
+  strTx.Format("<< %02x", ((uint8_t)data.initiator << 4) + (uint8_t)data.destination);
+  if (data.opcode_set)
+      strTx.AppendFormat(":%02x", (uint8_t)data.opcode);
 
   for (uint8_t iPtr = 0; iPtr < data.parameters.size; iPtr++)
     strTx.AppendFormat(":%02x", data.parameters[iPtr]);
@@ -200,6 +202,13 @@ bool CCECProcessor::SwitchMonitoring(bool bEnable)
     return SetAckMask(0x1 << (uint8_t)m_iLogicalAddress);
 }
 
+bool CCECProcessor::PollDevice(cec_logical_address iAddress)
+{
+  if (iAddress != CECDEVICE_UNKNOWN && m_busDevices[iAddress])
+    return m_busDevices[iAddress]->PollDevice();
+  return false;
+}
+
 cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
 {
   return m_busDevices[iAddress]->GetCecVersion();
@@ -394,6 +403,11 @@ void CCECProcessor::AddCommand(const cec_command &command)
   m_controller->AddCommand(command);
 }
 
+void CCECProcessor::AddKey(cec_keypress &key)
+{
+  m_controller->AddKey(key);
+}
+
 void CCECProcessor::AddKey(void)
 {
   m_controller->AddKey();