m_bInitialised(false),
m_communication(NULL),
m_libcec(libcec),
- m_bMonitor(false),
- m_iPreviousAckMask(0),
m_iStandardLineTimeout(3),
m_iRetryLineTimeout(3),
m_iLastTransmission(0)
}
// reset the other members to the initial state
- m_bMonitor = false;
- m_iPreviousAckMask = 0;
m_iStandardLineTimeout = 3;
m_iRetryLineTimeout = 3;
m_iLastTransmission = 0;
m_libcec->AddLog(CEC_LOG_TRAFFIC, strTx.c_str());
}
-bool CCECProcessor::SwitchMonitoring(bool bEnable)
-{
- m_libcec->AddLog(CEC_LOG_NOTICE, "== %s monitoring mode ==", bEnable ? "enabling" : "disabling");
-
- {
- CLockObject lock(m_mutex);
- // switch to monitoring mode, which will stop processing of incoming messages
- m_bMonitor = bEnable;
- // and store the current ackmask
- m_iPreviousAckMask = m_communication->GetAckMask();
- }
-
- // set the mask to 0 when enabling monitor mode
- if (bEnable)
- return SetAckMask(0);
- // and restore the previous mask otherwise
- else
- return SetAckMask(m_iPreviousAckMask);
-}
-
bool CCECProcessor::PollDevice(cec_logical_address iAddress)
{
// try to find the primary device
dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]);
m_libcec->AddLog(CEC_LOG_TRAFFIC, dataStr.c_str());
- // if we're not in monitor mode
- if (!m_bMonitor)
- {
- // find the initiator
- CCECBusDevice *device = m_busDevices->At(command.initiator);
- // and "handle" the command
- if (device)
- device->HandleCommand(command);
- }
+ // find the initiator
+ CCECBusDevice *device = m_busDevices->At(command.initiator);
+
+ if (device)
+ device->HandleCommand(command);
}
bool CCECProcessor::IsPresentDevice(cec_logical_address address)
return bReturn;
}
-void CCECProcessor::UnregisterClient(CCECClient *client)
+bool CCECProcessor::UnregisterClient(CCECClient *client)
{
if (!client)
- return;
+ return false;
if (client->IsRegistered())
m_libcec->AddLog(CEC_LOG_NOTICE, "unregistering client: %s", client->GetConnectionInfo().c_str());
}
// set the new ackmask
- SetAckMask(GetLogicalAddresses().AckMask());
+ return SetAckMask(GetLogicalAddresses().AckMask());
}
void CCECProcessor::UnregisterClients(void)