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:
7ff1180
)
don't log every frame, unless debugging was enabled in ./configure or visual studio
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 3 Oct 2012 15:54:56 +0000
(17:54 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 3 Oct 2012 15:55:57 +0000
(17:55 +0200)
configure.ac
patch
|
blob
|
blame
|
history
project/libcec.vcxproj
patch
|
blob
|
blame
|
history
src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
patch
|
blob
|
blame
|
history
src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp
patch
|
blob
|
blame
|
history
diff --git
a/configure.ac
b/configure.ac
index 73139486842052321f105605635bdf2bc5f711bf..4bd7648a95b964c631f87081ae8b0d9bb4344326 100644
(file)
--- a/
configure.ac
+++ b/
configure.ac
@@
-313,6
+313,7
@@
CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra -Wno-missing-field-initializers"
if test "x$use_debug" = "xyes"; then
CXXFLAGS="$CXXFLAGS -g"
if test "x$use_debug" = "xyes"; then
CXXFLAGS="$CXXFLAGS -g"
+ AC_DEFINE(CEC_DEBUGGING,"1", "generate libCEC debug output")
fi
if test "x$optimisation" = "xyes"; then
fi
if test "x$optimisation" = "xyes"; then
diff --git
a/project/libcec.vcxproj
b/project/libcec.vcxproj
index dd529e1b454008fd7d1f9a387eba321f68c503ea..fca963584b394266b155de494885bbc7e1325c47 100644
(file)
--- a/
project/libcec.vcxproj
+++ b/
project/libcec.vcxproj
@@
-181,7
+181,7
@@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>HAVE_P8_USB;_USE_32BIT_TIME_T;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>
CEC_DEBUGGING;
HAVE_P8_USB;_USE_32BIT_TIME_T;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
@@
-197,7
+197,7
@@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>HAVE_P8_USB;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>
CEC_DEBUGGING;
HAVE_P8_USB;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
@@
-267,4
+267,4
@@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git
a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
index a2c33e789fcac8b3793c2a2b2ac60a11ec84fe1c..3d36497de409cd5c66c0f1591f1ebffc83a35089 100644
(file)
--- a/
src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
+++ b/
src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
@@
-384,7
+384,9
@@
bool CUSBCECAdapterCommunication::WriteToDevice(CCECAdapterMessage *message)
return false;
}
return false;
}
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "command '%s' sent", message->IsTranmission() ? "CEC transmission" : CCECAdapterMessage::ToString(message->Message()));
LIB_CEC->AddLog(CEC_LOG_DEBUG, "command '%s' sent", message->IsTranmission() ? "CEC transmission" : CCECAdapterMessage::ToString(message->Message()));
+#endif
message->state = ADAPTER_MESSAGE_STATE_SENT;
return true;
}
message->state = ADAPTER_MESSAGE_STATE_SENT;
return true;
}
diff --git
a/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp
b/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp
index 77f93c71d98287bc1b011c6acfbd9e8a3939dca3..35faeb71890b73892fb7a5c67b17b532b2a3d625 100644
(file)
--- a/
src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp
+++ b/
src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp
@@
-203,12
+203,14
@@
bool CCECAdapterMessageQueueEntry::MessageReceivedCommandAccepted(const CCECAdap
/* decrease by 1 */
m_iPacketsLeft--;
/* decrease by 1 */
m_iPacketsLeft--;
+#ifdef CEC_DEBUGGING
/* log this message */
CStdString strLog;
strLog.Format("%s - command accepted", ToString());
if (m_iPacketsLeft > 0)
strLog.AppendFormat(" - waiting for %d more", m_iPacketsLeft);
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, strLog);
/* log this message */
CStdString strLog;
strLog.Format("%s - command accepted", ToString());
if (m_iPacketsLeft > 0)
strLog.AppendFormat(" - waiting for %d more", m_iPacketsLeft);
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, strLog);
+#endif
/* no more packets left and not a transmission, so we're done */
if (!m_message->IsTranmission() && m_iPacketsLeft == 0)
/* no more packets left and not a transmission, so we're done */
if (!m_message->IsTranmission() && m_iPacketsLeft == 0)
@@
-234,7
+236,9
@@
bool CCECAdapterMessageQueueEntry::MessageReceivedTransmitSucceeded(const CCECAd
if (m_iPacketsLeft == 0)
{
/* transmission succeeded, so we're done */
if (m_iPacketsLeft == 0)
{
/* transmission succeeded, so we're done */
+#ifdef CEC_DEBUGGING
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - transmit succeeded", m_message->ToString().c_str());
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - transmit succeeded", m_message->ToString().c_str());
+#endif
m_message->state = ADAPTER_MESSAGE_STATE_SENT_ACKED;
m_message->response = message.packet;
}
m_message->state = ADAPTER_MESSAGE_STATE_SENT_ACKED;
m_message->response = message.packet;
}
@@
-256,7
+260,9
@@
bool CCECAdapterMessageQueueEntry::MessageReceivedResponse(const CCECAdapterMess
{
{
CLockObject lock(m_mutex);
{
{
CLockObject lock(m_mutex);
+#ifdef CEC_DEBUGGING
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - received response - %s", ToString(), message.ToString().c_str());
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - received response - %s", ToString(), message.ToString().c_str());
+#endif
m_message->response = message.packet;
if (m_message->IsTranmission())
m_message->state = message.Message() == MSGCODE_TRANSMIT_SUCCEEDED ? ADAPTER_MESSAGE_STATE_SENT_ACKED : ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED;
m_message->response = message.packet;
if (m_message->IsTranmission())
m_message->state = message.Message() == MSGCODE_TRANSMIT_SUCCEEDED ? ADAPTER_MESSAGE_STATE_SENT_ACKED : ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED;
@@
-365,7
+371,12
@@
void CCECAdapterMessageQueue::MessageReceived(const CCECAdapterMessage &msg)
{
/* the message wasn't handled */
bool bIsError(m_com->HandlePoll(msg));
{
/* the message wasn't handled */
bool bIsError(m_com->HandlePoll(msg));
+#ifdef CEC_DEBUGGING
m_com->m_callback->GetLib()->AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString().c_str());
m_com->m_callback->GetLib()->AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString().c_str());
+#else
+ if (bIsError)
+ m_com->m_callback->GetLib()->AddLog(CEC_LOG_WARNING, msg.ToString().c_str());
+#endif
/* push this message to the current frame */
if (!bIsError && msg.PushToCecCommand(m_currentCECFrame))
/* push this message to the current frame */
if (!bIsError && msg.PushToCecCommand(m_currentCECFrame))