Skip to content

Commit a11f608

Browse files
committed
Adding CCEC Namespace
1 parent 991452f commit a11f608

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

HdmiCecSink/HdmiCecSinkImplementation.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* limitations under the License.
1818
**/
1919

20-
#define CCEC_NAMESPACE // Enable CCEC namespace
2120
#include "HdmiCecSinkImplementation.h"
2221

2322
#include "ccec/CCEC.hpp"
@@ -39,6 +38,12 @@
3938
#include "UtilssyncPersistFile.h"
4039
#include "UtilsSearchRDKProfile.h"
4140

41+
// Type aliases to resolve conflicts between CCEC message classes and implementation methods
42+
// CCEC classes are in global namespace when CCEC_NAMESPACE is not defined in headers
43+
using CCECRequestActiveSource = RequestActiveSource;
44+
using CCECSetMenuLanguage = SetMenuLanguage;
45+
using CCECRequestShortAudioDescriptor = RequestShortAudioDescriptor;
46+
4247
#define TEST_ADD 0
4348
#define HDMICECSINK_REQUEST_MAX_RETRY 3
4449
#define HDMICECSINK_REQUEST_MAX_WAIT_TIME_MS 2000
@@ -2040,7 +2045,7 @@ namespace WPEFramework
20402045

20412046

20422047
_instance->smConnection->sendTo(LogicalAddress::BROADCAST,
2043-
MessageEncoder().encode(CCEC::RequestActiveSource()), 500);
2048+
MessageEncoder().encode(CCECRequestActiveSource()), 500);
20442049
}
20452050

20462051
void HdmiCecSinkImplementation::setActiveSource(bool isResponse)
@@ -2104,7 +2109,7 @@ namespace WPEFramework
21042109

21052110
lang = _instance->deviceList[_instance->m_logicalAddressAllocated].m_currentLanguage;
21062111

2107-
_instance->smConnection->sendTo(LogicalAddress::BROADCAST, MessageEncoder().encode(CCEC::SetMenuLanguage(lang)), 100);
2112+
_instance->smConnection->sendTo(LogicalAddress::BROADCAST, MessageEncoder().encode(CCECSetMenuLanguage(lang)), 100);
21082113
}
21092114

21102115
void HdmiCecSinkImplementation::updateInActiveSource(const int logical_address, const InActiveSource &source )
@@ -2203,7 +2208,7 @@ namespace WPEFramework
22032208
}
22042209

22052210
LOGINFO(" Send requestShortAudioDescriptor Message ");
2206-
_instance->smConnection->sendTo(LogicalAddress::AUDIO_SYSTEM,MessageEncoder().encode(CCEC::RequestShortAudioDescriptor(formatid,audioFormatCode,numberofdescriptor)), 1000);
2211+
_instance->smConnection->sendTo(LogicalAddress::AUDIO_SYSTEM,MessageEncoder().encode(CCECRequestShortAudioDescriptor(formatid,audioFormatCode,numberofdescriptor)), 1000);
22072212

22082213
}
22092214

HdmiCecSource/HdmiCecSourceImplementation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* limitations under the License.
1818
**/
1919

20-
#define CCEC_NAMESPACE // Enable CCEC namespace
2120
#include "HdmiCecSourceImplementation.h"
2221

2322
#include "ccec/CCEC.hpp"
@@ -37,6 +36,10 @@
3736
#include "UtilssyncPersistFile.h"
3837
#include "UtilsSearchRDKProfile.h"
3938

39+
// Type alias to resolve conflict between CCEC message class and implementation method
40+
// CCEC classes are in global namespace when CCEC_NAMESPACE is not defined in headers
41+
using CCECRequestActiveSource = RequestActiveSource;
42+
4043
#define HDMICECSOURCE_METHOD_SET_ENABLED "SetEnabled"
4144
#define HDMICECSOURCE_METHOD_GET_ENABLED "GetEnabled"
4245
#define HDMICECSOURCE_METHOD_OTP_SET_ENABLED "SetOTPEnabled"
@@ -1032,7 +1035,7 @@ namespace WPEFramework
10321035
LOGINFO("Command: sending GiveDevicePowerStatus \r\n");
10331036
smConnection->sendTo(LogicalAddress::TV, MessageEncoder().encode(GiveDevicePowerStatus()));
10341037
LOGINFO("Command: sending request active Source isDeviceActiveSource is set to false\r\n");
1035-
smConnection->sendTo(LogicalAddress::BROADCAST, MessageEncoder().encode(CCEC::RequestActiveSource()));
1038+
smConnection->sendTo(LogicalAddress::BROADCAST, MessageEncoder().encode(CCECRequestActiveSource()));
10361039
isDeviceActiveSource = false;
10371040
LOGINFO("Command: GiveDeviceVendorID sending VendorID response :%s\n", \
10381041
(isLGTvConnected)?lgVendorId.toString().c_str():appVendorId.toString().c_str());

0 commit comments

Comments
 (0)