From: Lars Op den Kamp Date: Tue, 4 Oct 2011 22:12:37 +0000 (+0200) Subject: cec: forgot the physical address when doing the int parameters, resulting in a wronly... X-Git-Tag: upstream/2.2.0~1^2~287 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2b4d8297d88c0676392e8b3c9c3e3d7ef3e80408;p=deb_libcec.git cec: forgot the physical address when doing the int parameters, resulting in a wronly reported physical address --- diff --git a/include/CECExportsC.h b/include/CECExportsC.h index b96beba..2a6b614 100644 --- a/include/CECExportsC.h +++ b/include/CECExportsC.h @@ -46,9 +46,9 @@ extern "C" { * @return True when initialised, false otherwise. */ #ifdef __cplusplus -extern DECLSPEC bool cec_init(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint8_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); +extern DECLSPEC bool cec_init(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); #else -extern DECLSPEC bool cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint8_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); +extern DECLSPEC bool cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); #endif /*! diff --git a/include/CECExportsCpp.h b/include/CECExportsCpp.h index f0a0ac9..f9fb0ab 100644 --- a/include/CECExportsCpp.h +++ b/include/CECExportsCpp.h @@ -122,7 +122,7 @@ namespace CEC }; }; -extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint8_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); +extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); #if !defined(DLL_EXPORT) #if defined(_WIN32) || defined(_WIN64) @@ -135,7 +135,7 @@ static int g_iLibCECInstanceCount = 0; /*! * @see cec_init */ -inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint8_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) +inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint8_t); _CreateLibCec CreateLibCec; @@ -172,7 +172,7 @@ inline void UnloadLibCec(CEC::ICECAdapter *device) /*! * @see cec_init */ -inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) +inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { return (CEC::ICECAdapter*) CECCreate(strName, iLogicalAddress, iPhysicalAddress); }; diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 258e164..2133080 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -40,7 +40,7 @@ using namespace CEC; using namespace std; -CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, int iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) : +CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) : m_physicaladdress(iPhysicalAddress), m_iLogicalAddress(iLogicalAddress), m_strDeviceName(strDeviceName), diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index aea17c8..90db3bc 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -46,7 +46,7 @@ namespace CEC class CCECProcessor : public CThread { public: - CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); + CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); virtual ~CCECProcessor(void); virtual bool Start(void); @@ -76,7 +76,7 @@ namespace CEC void ParseCurrentFrame(void); cec_frame m_currentframe; - int m_physicaladdress; + uint16_t m_physicaladdress; cec_logical_address m_iLogicalAddress; CecBuffer m_frameBuffer; std::string m_strDeviceName; diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index 3437e45..47554d6 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -41,7 +41,7 @@ using namespace std; using namespace CEC; -CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint8_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) : +CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) : m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), m_buttontime(0) { @@ -233,7 +233,7 @@ void CLibCEC::SetCurrentButton(cec_user_control_code iButtonCode) m_buttontime = GetTimeMs(); } -DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint8_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) +DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) { return static_cast< void* > (new CLibCEC(strDeviceName, iLogicalAddress, iPhysicalAddress)); } diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index cb9eb8c..2911071 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -47,7 +47,7 @@ namespace CEC * ICECAdapter implementation */ //@{ - CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint8_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); + CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); virtual ~CLibCEC(void); virtual bool Open(const char *strPort, uint64_t iTimeout = 10000);