cec: added PollDevice()/cec_poll_device()
[deb_libcec.git] / src / lib / CECProcessor.cpp
index f781b6fb58b94f99f970a8eb2248937f958aa1cc..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();