repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cec: added a firmware flash script for linux. usage: ./support/cec-flash-device.sh...
[deb_libcec.git]
/
src
/
lib
/
implementations
/
CECCommandHandler.cpp
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index 1773507f54087ecdb516c04999a1c0e40d4b0111..d407e40221df6aad75f61c354ee5d8ddca96a455 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-38,6
+38,7
@@
using namespace CEC;
using namespace std;
using namespace CEC;
using namespace std;
+using namespace PLATFORM;
CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice) :
m_busDevice(busDevice),
CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice) :
m_busDevice(busDevice),
@@
-48,15
+49,15
@@
CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice) :
m_bHandlerInited(false),
m_iUseCounter(0),
m_expectedResponse(CEC_OPCODE_NONE),
m_bHandlerInited(false),
m_iUseCounter(0),
m_expectedResponse(CEC_OPCODE_NONE),
- m_bOPTSendDeckStatusUpdateOnActiveSource(
tru
e),
+ m_bOPTSendDeckStatusUpdateOnActiveSource(
fals
e),
m_vendorId(CEC_VENDOR_UNKNOWN)
{
}
CCECCommandHandler::~CCECCommandHandler(void)
{
m_vendorId(CEC_VENDOR_UNKNOWN)
{
}
CCECCommandHandler::~CCECCommandHandler(void)
{
- CLockObject lock(
&
m_processor->m_transmitMutex);
- CLockObject receiveLock(
&
m_receiveMutex);
+ CLockObject lock(m_processor->m_transmitMutex);
+ CLockObject receiveLock(m_receiveMutex);
m_condition.Broadcast();
}
m_condition.Broadcast();
}
@@
-194,7
+195,7
@@
bool CCECCommandHandler::HandleCommand(const cec_command &command)
if (bHandled)
{
if (bHandled)
{
- CLockObject lock(
&
m_receiveMutex);
+ CLockObject lock(m_receiveMutex);
if (m_expectedResponse == CEC_OPCODE_NONE ||
m_expectedResponse == command.opcode)
m_condition.Signal();
if (m_expectedResponse == CEC_OPCODE_NONE ||
m_expectedResponse == command.opcode)
m_condition.Signal();
@@
-426,7
+427,7
@@
bool CCECCommandHandler::HandleRequestActiveSource(const cec_command &command)
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
vector<CCECBusDevice *> devices;
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
vector<CCECBusDevice *> devices;
- for (
int iDevicePtr = (int)GetMyDevices(devices)-1; iDevicePtr >=0; iDevicePtr--
)
+ for (
size_t iDevicePtr = 0; iDevicePtr < GetMyDevices(devices); iDevicePtr++
)
devices[iDevicePtr]->TransmitActiveSource();
return true;
devices[iDevicePtr]->TransmitActiveSource();
return true;
@@
-639,6
+640,11
@@
bool CCECCommandHandler::HandleUserControlRelease(const cec_command &command)
return true;
}
return true;
}
+bool CCECCommandHandler::HandleVendorCommand(const cec_command & UNUSED(command))
+{
+ return true;
+}
+
void CCECCommandHandler::UnhandledCommand(const cec_command &command)
{
CStdString strLog;
void CCECCommandHandler::UnhandledCommand(const cec_command &command)
{
CStdString strLog;
@@
-646,9
+652,9
@@
void CCECCommandHandler::UnhandledCommand(const cec_command &command)
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog);
}
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog);
}
-
unsigned in
t CCECCommandHandler::GetMyDevices(vector<CCECBusDevice *> &devices) const
+
size_
t CCECCommandHandler::GetMyDevices(vector<CCECBusDevice *> &devices) const
{
{
-
unsigned in
t iReturn(0);
+
size_
t iReturn(0);
cec_logical_addresses addresses = m_processor->GetLogicalAddresses();
for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
cec_logical_addresses addresses = m_processor->GetLogicalAddresses();
for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
@@
-837,7
+843,7
@@
bool CCECCommandHandler::TransmitOSDName(const cec_logical_address iInitiator, c
{
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_OSD_NAME);
{
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_OSD_NAME);
- for (
unsigned in
t iPtr = 0; iPtr < strDeviceName.length(); iPtr++)
+ for (
size_
t iPtr = 0; iPtr < strDeviceName.length(); iPtr++)
command.parameters.PushBack(strDeviceName.at(iPtr));
return Transmit(command, false);
command.parameters.PushBack(strDeviceName.at(iPtr));
return Transmit(command, false);
@@
-849,10
+855,10
@@
bool CCECCommandHandler::TransmitOSDString(const cec_logical_address iInitiator,
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_OSD_STRING);
command.parameters.PushBack((uint8_t)duration);
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_OSD_STRING);
command.parameters.PushBack((uint8_t)duration);
-
unsigned in
t iLen = strlen(strMessage);
+
size_
t iLen = strlen(strMessage);
if (iLen > 13) iLen = 13;
if (iLen > 13) iLen = 13;
- for (
unsigned in
t iPtr = 0; iPtr < iLen; iPtr++)
+ for (
size_
t iPtr = 0; iPtr < iLen; iPtr++)
command.parameters.PushBack(strMessage[iPtr]);
return Transmit(command, false);
command.parameters.PushBack(strMessage[iPtr]);
return Transmit(command, false);
@@
-959,8
+965,8
@@
bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /*
{
uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries + 1);
{
uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries + 1);
- CLockObject writeLock(
&
m_processor->m_transmitMutex);
- CLockObject receiveLock(
&
m_receiveMutex);
+ CLockObject writeLock(m_processor->m_transmitMutex);
+ CLockObject receiveLock(m_receiveMutex);
++m_iUseCounter;
while (!bReturn && ++iTries <= iMaxTries)
{
++m_iUseCounter;
while (!bReturn && ++iTries <= iMaxTries)
{
@@
-969,7
+975,7
@@
bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /*
{
m_processor->AddLog(CEC_LOG_DEBUG, "command transmitted");
bReturn = bExpectResponse ?
{
m_processor->AddLog(CEC_LOG_DEBUG, "command transmitted");
bReturn = bExpectResponse ?
- m_condition.Wait(
&
m_receiveMutex, m_iTransmitWait) :
+ m_condition.Wait(m_receiveMutex, m_iTransmitWait) :
true;
}
}
true;
}
}
@@
-988,11
+994,6
@@
bool CCECCommandHandler::ActivateSource(void)
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
- if ((m_busDevice->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
- m_busDevice->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
- SendDeckStatusUpdateOnActiveSource())
- ((CCECPlaybackDevice *)m_busDevice)->TransmitDeckStatus(CECDEVICE_TV);
-
if (m_processor->GetPrimaryDevice()->GetPhysicalAddress(false) != 0xffff)
{
m_processor->SetActiveSource();
if (m_processor->GetPrimaryDevice()->GetPhysicalAddress(false) != 0xffff)
{
m_processor->SetActiveSource();
@@
-1005,18
+1006,18
@@
bool CCECCommandHandler::ActivateSource(void)
void CCECCommandHandler::MarkBusy(void)
{
void CCECCommandHandler::MarkBusy(void)
{
- CLockObject receiveLock(
&
m_receiveMutex);
+ CLockObject receiveLock(m_receiveMutex);
++m_iUseCounter;
}
bool CCECCommandHandler::MarkReady(void)
{
++m_iUseCounter;
}
bool CCECCommandHandler::MarkReady(void)
{
- CLockObject receiveLock(
&
m_receiveMutex);
+ CLockObject receiveLock(m_receiveMutex);
return m_iUseCounter > 0 ? (--m_iUseCounter == 0) : true;
}
bool CCECCommandHandler::InUse(void)
{
return m_iUseCounter > 0 ? (--m_iUseCounter == 0) : true;
}
bool CCECCommandHandler::InUse(void)
{
- CLockObject receiveLock(
&
m_receiveMutex);
+ CLockObject receiveLock(m_receiveMutex);
return m_iUseCounter > 0;
}
return m_iUseCounter > 0;
}