less debug logging by default
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 15 Oct 2012 10:15:23 +0000 (12:15 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 15 Oct 2012 10:54:28 +0000 (12:54 +0200)
src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.cpp
src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp
src/lib/adapter/RPi/RPiCECAdapterMessageQueue.cpp
src/lib/implementations/CECCommandHandler.cpp

index cf97ea9f3593e7ab01320f25b7a2deff6811616e..717e7d3f3e7be4225051e9ef12d4e903be5ffe55 100644 (file)
@@ -85,7 +85,9 @@ uint16_t CUSBCECAdapterCommands::RequestFirmwareVersion(void)
 
   while (m_persistedConfiguration.iFirmwareVersion == CEC_FW_VERSION_UNKNOWN && iFwVersionTry++ < 3)
   {
+#ifdef CEC_DEBUGGING
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting the firmware version");
+#endif
     cec_datapacket response = RequestSetting(MSGCODE_FIRMWARE_VERSION);
     if (response.size == 2)
       m_persistedConfiguration.iFirmwareVersion = (response[0] << 8 | response[1]);
@@ -107,7 +109,9 @@ uint16_t CUSBCECAdapterCommands::RequestFirmwareVersion(void)
 
 bool CUSBCECAdapterCommands::RequestSettingAutoEnabled(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting autonomous mode setting");
+#endif
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_AUTO_ENABLED);
   if (response.size == 1)
@@ -121,7 +125,9 @@ bool CUSBCECAdapterCommands::RequestSettingAutoEnabled(void)
 
 bool CUSBCECAdapterCommands::RequestSettingCECVersion(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting CEC version setting");
+#endif
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_HDMI_VERSION);
   if (response.size == 1)
@@ -137,7 +143,9 @@ p8_cec_adapter_type CUSBCECAdapterCommands::RequestAdapterType(void)
 {
   if (m_adapterType == P8_ADAPTERTYPE_UNKNOWN)
   {
+#ifdef CEC_DEBUGGING
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting adapter type");
+#endif
 
     cec_datapacket response = RequestSetting(MSGCODE_GET_ADAPTER_TYPE);
     if (response.size == 1)
@@ -150,7 +158,9 @@ uint32_t CUSBCECAdapterCommands::RequestBuildDate(void)
 {
   if (m_iBuildDate == CEC_FW_BUILD_UNKNOWN)
   {
+#ifdef CEC_DEBUGGING
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting firmware build date");
+#endif
 
     cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE);
     if (response.size == 4)
@@ -161,7 +171,9 @@ uint32_t CUSBCECAdapterCommands::RequestBuildDate(void)
 
 bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting default logical address setting");
+#endif
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_DEFAULT_LOGICAL_ADDRESS);
   if (response.size == 1)
@@ -175,7 +187,9 @@ bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)
 
 bool CUSBCECAdapterCommands::RequestSettingDeviceType(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting device type setting");
+#endif
   m_persistedConfiguration.deviceTypes.Clear();
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_DEVICE_TYPE);
@@ -191,7 +205,9 @@ bool CUSBCECAdapterCommands::RequestSettingDeviceType(void)
 
 bool CUSBCECAdapterCommands::RequestSettingLogicalAddressMask(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting logical address mask setting");
+#endif
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_LOGICAL_ADDRESS_MASK);
   if (response.size == 2)
@@ -205,7 +221,9 @@ bool CUSBCECAdapterCommands::RequestSettingLogicalAddressMask(void)
 
 bool CUSBCECAdapterCommands::RequestSettingOSDName(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting OSD name setting");
+#endif
 
   memset(m_persistedConfiguration.strDeviceName, 0, 13);
   cec_datapacket response = RequestSetting(MSGCODE_GET_OSD_NAME);
@@ -227,7 +245,9 @@ bool CUSBCECAdapterCommands::RequestSettingOSDName(void)
 
 bool CUSBCECAdapterCommands::RequestSettingPhysicalAddress(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting physical address setting");
+#endif
 
   cec_datapacket response = RequestSetting(MSGCODE_GET_PHYSICAL_ADDRESS);
   if (response.size == 2)
@@ -544,7 +564,9 @@ bool CUSBCECAdapterCommands::GetConfiguration(libcec_configuration &configuratio
 
 bool CUSBCECAdapterCommands::PingAdapter(void)
 {
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending ping");
+#endif
 
   CCECAdapterMessage params;
   CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_PING, params);
index daaa72ab17d96eda8c3184c142fa921f05f3de70..e1fcae6af7cd5caf561afe94e918ca6b78f23b06 100644 (file)
@@ -110,7 +110,9 @@ void CRPiCECAdapterCommunication::OnDataReceived(uint32_t header, uint32_t p0, u
 {
   VC_CEC_NOTIFY_T reason = (VC_CEC_NOTIFY_T)CEC_CB_REASON(header);
 
+#ifdef CEC_DEBUGGING
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "received data: header:%08X p0:%08X p1:%08X p2:%08X p3:%08X reason:%x", header, p0, p1, p2, p3, reason);
+#endif
 
   switch (reason)
   {
index df9a374dc4ad07b9746ebcd25a94dc7fff97c980..656a25d0a2d54243983a7b813007481cc4ea18ba 100644 (file)
@@ -151,11 +151,13 @@ bool CRPiCECAdapterMessageQueue::Write(const cec_command &command, bool bIsReply
       message.payload[iPtr + 1] = command.parameters.At(iPtr);
   }
 
+#ifdef CEC_DEBUGGING
   CStdString strDump;
   strDump.Format("len = %d, payload = %X%X", message.length, (int)message.initiator, (int)message.follower);
   for (uint8_t iPtr = 0; iPtr < message.length - 1; iPtr++)
     strDump.AppendFormat(":%02X", message.payload[iPtr]);
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending data: %s", strDump.c_str());
+#endif
 
   int iReturn = vc_cec_send_message2(&message);
 #else
@@ -172,11 +174,13 @@ bool CRPiCECAdapterMessageQueue::Write(const cec_command &command, bool bIsReply
       payload[iPtr + 1] = command.parameters.At(iPtr);
   }
 
+#ifdef CEC_DEBUGGING
   CStdString strDump;
   strDump.Format("len = %d, payload = %X%X", iLength, (int)command.initiator, (int)command.destination);
   for (uint8_t iPtr = 0; iPtr < iLength; iPtr++)
     strDump.AppendFormat(":%02X", payload[iPtr]);
   LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending data: %s", strDump.c_str());
+#endif
 
    int iReturn = vc_cec_send_message((uint32_t)command.destination, (uint8_t*)&payload, iLength, bIsReply);
 #endif
index 8dcc2559dbad3eb8e57cec211dfcef8ad6453132..da578b1173fa394d9c389dbe9cef427f5746945b 100644 (file)
@@ -1100,7 +1100,9 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bSuppressWait, bool
     {
       if ((bReturn = m_processor->Transmit(command, bIsReply)) == true)
       {
+#ifdef CEC_DEBUGGING
         LIB_CEC->AddLog(CEC_LOG_DEBUG, "command transmitted");
+#endif
         if (bExpectResponse)
         {
           bReturn = m_busDevice->WaitForOpcode(expectedResponse);