X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2FCECProcessor.cpp;h=468d981776f900768e3d8a3655ddb325044b008d;hb=3d0dca16aebce0c4bd125a05acf28d340138d874;hp=eae4c3cfa7b3b2e92eeae6d3623feaed19c43b39;hpb=e9de9629478f63b357b69314d7935c6539c3ad71;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index eae4c3c..468d981 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -58,7 +58,8 @@ CCECProcessor::~CCECProcessor(void) StopThread(); m_communication = NULL; m_controller = NULL; - delete[] m_busDevices; + for (unsigned int iPtr = 0; iPtr < 16; iPtr++) + delete m_busDevices[iPtr]; } bool CCECProcessor::Start(void) @@ -113,6 +114,9 @@ void *CCECProcessor::Process(void) m_controller->CheckKeypressTimeout(); + for (unsigned int iDevicePtr = 0; iDevicePtr < 16; iDevicePtr++) + m_busDevices[iDevicePtr]->PollVendorId(); + if (!IsStopped()) Sleep(5); } @@ -182,13 +186,12 @@ bool CCECProcessor::SetInactiveView(void) void CCECProcessor::LogOutput(const cec_command &data) { - CStdString txStr = "transmit "; - txStr.AppendFormat(" %02x", ((uint8_t)data.initiator << 4) + (uint8_t)data.destination); - txStr.AppendFormat(":%02x", (uint8_t)data.opcode); + CStdString strTx; + strTx.Format("<< %02x:%02x", ((uint8_t)data.initiator << 4) + (uint8_t)data.destination, (uint8_t)data.opcode); for (uint8_t iPtr = 0; iPtr < data.parameters.size; iPtr++) - txStr.AppendFormat(":%02x", data.parameters[iPtr]); - m_controller->AddLog(CEC_LOG_DEBUG, txStr.c_str()); + strTx.AppendFormat(":%02x", data.parameters[iPtr]); + m_controller->AddLog(CEC_LOG_TRAFFIC, strTx.c_str()); } bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true */) @@ -539,10 +542,10 @@ void CCECProcessor::ParseVendorId(cec_logical_address device, const cec_datapack void CCECProcessor::ParseCommand(cec_command &command) { CStdString dataStr; - dataStr.Format(">> received frame: %1x%1x:%02x", command.initiator, command.destination, command.opcode); + dataStr.Format(">> %1x%1x:%02x", command.initiator, command.destination, command.opcode); for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++) dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]); - m_controller->AddLog(CEC_LOG_DEBUG, dataStr.c_str()); + m_controller->AddLog(CEC_LOG_TRAFFIC, dataStr.c_str()); if (!m_bMonitor) m_busDevices[(uint8_t)command.initiator]->HandleCommand(command);