repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
20fd14a
)
fixed - updating the device status after a poll was broken and could reset the status...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 15 Oct 2012 10:13:09 +0000
(12:13 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 15 Oct 2012 10:13:09 +0000
(12:13 +0200)
src/lib/CECClient.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/devices/CECBusDevice.cpp
patch
|
blob
|
blame
|
history
src/lib/devices/CECBusDevice.h
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECClient.cpp
b/src/lib/CECClient.cpp
index f85a53c2a6cae81bae6d17134ffa6b2fc3313f6e..a5a960ea36b00e4c804c3362b088e855550fdde3 100644
(file)
--- a/
src/lib/CECClient.cpp
+++ b/
src/lib/CECClient.cpp
@@
-1255,7
+1255,7
@@
bool CCECClient::PollDevice(const cec_logical_address iAddress)
CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
- return primary->TransmitPoll(iAddress,
fals
e);
+ return primary->TransmitPoll(iAddress,
tru
e);
return m_processor ? m_processor->PollDevice(iAddress) : false;
}
return m_processor ? m_processor->PollDevice(iAddress) : false;
}
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index cc6adda8bf4826bfb0c28f63975bae66e60bfd94..73c921d8120f68c0ffff4f440e6e66e2e0443b07 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-315,11
+315,11
@@
bool CCECProcessor::PollDevice(cec_logical_address iAddress)
CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
- return primary->TransmitPoll(iAddress,
fals
e);
+ return primary->TransmitPoll(iAddress,
tru
e);
CCECBusDevice *device = m_busDevices->At(CECDEVICE_UNREGISTERED);
if (device)
CCECBusDevice *device = m_busDevices->At(CECDEVICE_UNREGISTERED);
if (device)
- return device->TransmitPoll(iAddress,
fals
e);
+ return device->TransmitPoll(iAddress,
tru
e);
return false;
}
return false;
}
diff --git
a/src/lib/devices/CECBusDevice.cpp
b/src/lib/devices/CECBusDevice.cpp
index b42230dd41201913a0331e18f3b9c57aee874ec7..a33a9c3ede3b5e152694664b7b5327a09f4dc376 100644
(file)
--- a/
src/lib/devices/CECBusDevice.cpp
+++ b/
src/lib/devices/CECBusDevice.cpp
@@
-741,7
+741,8
@@
cec_bus_device_status CCECBusDevice::GetStatus(bool bForcePoll /* = false */, bo
CLockObject lock(m_mutex);
status = m_deviceStatus;
bNeedsPoll = !bSuppressPoll &&
CLockObject lock(m_mutex);
status = m_deviceStatus;
bNeedsPoll = !bSuppressPoll &&
- (bForcePoll || m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN);
+ (bForcePoll || m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN) &&
+ m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
}
if (bNeedsPoll)
}
if (bNeedsPoll)
@@
-782,6
+783,7
@@
void CCECBusDevice::SetDeviceStatus(const cec_bus_device_status newStatus, cec_v
if (m_deviceStatus != newStatus)
LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): device status changed into 'present'", GetLogicalAddressName(), m_iLogicalAddress);
m_deviceStatus = newStatus;
if (m_deviceStatus != newStatus)
LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): device status changed into 'present'", GetLogicalAddressName(), m_iLogicalAddress);
m_deviceStatus = newStatus;
+ m_iLastActive = GetTimeMs();
break;
case CEC_DEVICE_STATUS_NOT_PRESENT:
if (m_deviceStatus != newStatus)
break;
case CEC_DEVICE_STATUS_NOT_PRESENT:
if (m_deviceStatus != newStatus)
@@
-819,7
+821,7
@@
void CCECBusDevice::ResetDeviceStatus(void)
m_deviceStatus = CEC_DEVICE_STATUS_UNKNOWN;
}
m_deviceStatus = CEC_DEVICE_STATUS_UNKNOWN;
}
-bool CCECBusDevice::TransmitPoll(const cec_logical_address dest, bool b
IsReply
)
+bool CCECBusDevice::TransmitPoll(const cec_logical_address dest, bool b
UpdateDeviceStatus
)
{
bool bReturn(false);
cec_logical_address destination(dest);
{
bool bReturn(false);
cec_logical_address destination(dest);
@@
-832,17
+834,11
@@
bool CCECBusDevice::TransmitPoll(const cec_logical_address dest, bool bIsReply)
MarkBusy();
LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): POLL", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest);
MarkBusy();
LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): POLL", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest);
- bReturn = m_handler->TransmitPoll(m_iLogicalAddress, destination,
bIsReply
);
+ bReturn = m_handler->TransmitPoll(m_iLogicalAddress, destination,
false
);
LIB_CEC->AddLog(CEC_LOG_DEBUG, bReturn ? ">> POLL sent" : ">> POLL not sent");
LIB_CEC->AddLog(CEC_LOG_DEBUG, bReturn ? ">> POLL sent" : ">> POLL not sent");
- CLockObject lock(m_mutex);
- if (bReturn)
- {
- m_iLastActive = GetTimeMs();
- SetDeviceStatus(CEC_DEVICE_STATUS_PRESENT);
- }
- else
- SetDeviceStatus(CEC_DEVICE_STATUS_NOT_PRESENT);
+ if (bUpdateDeviceStatus)
+ destDevice->SetDeviceStatus(bReturn ? CEC_DEVICE_STATUS_PRESENT : CEC_DEVICE_STATUS_NOT_PRESENT);
MarkReady();
return bReturn;
MarkReady();
return bReturn;
diff --git
a/src/lib/devices/CECBusDevice.h
b/src/lib/devices/CECBusDevice.h
index d208fd933d44bd94b7e6f6c944cff79e2e1fbdb8..fad7191e6be216ac2bd83c7898681acb5e8892c0 100644
(file)
--- a/
src/lib/devices/CECBusDevice.h
+++ b/
src/lib/devices/CECBusDevice.h
@@
-206,7
+206,7
@@
namespace CEC
virtual cec_bus_device_status GetStatus(bool bForcePoll = false, bool bSuppressPoll = false);
virtual void SetDeviceStatus(const cec_bus_device_status newStatus, cec_version libCECSpecVersion = CEC_VERSION_1_4);
virtual void ResetDeviceStatus(void);
virtual cec_bus_device_status GetStatus(bool bForcePoll = false, bool bSuppressPoll = false);
virtual void SetDeviceStatus(const cec_bus_device_status newStatus, cec_version libCECSpecVersion = CEC_VERSION_1_4);
virtual void ResetDeviceStatus(void);
- virtual bool TransmitPoll(const cec_logical_address destination, bool b
IsReply
);
+ virtual bool TransmitPoll(const cec_logical_address destination, bool b
UpdateDeviceStatus
);
virtual void HandlePoll(const cec_logical_address destination);
virtual void HandlePollFrom(const cec_logical_address initiator);
virtual bool HandleReceiveFailed(void);
virtual void HandlePoll(const cec_logical_address destination);
virtual void HandlePollFrom(const cec_logical_address initiator);
virtual bool HandleReceiveFailed(void);