From: Lars Op den Kamp Date: Thu, 3 Nov 2011 23:15:11 +0000 (+0100) Subject: Merge branch 'master' into release X-Git-Tag: upstream/2.2.0~1^2~118^2~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=82b65f18fa44f1f9a673f10d917b2efdf087e565;hp=b3efc8f2094dc9f6d682b05321bf2ad82118332e;p=deb_libcec.git Merge branch 'master' into release --- diff --git a/README b/README index c5f1080..6c23712 100644 --- a/README +++ b/README @@ -7,7 +7,6 @@ To install libCEC on Linux: # sudo make install To install libCEC on Windows: -* go to /project and execute download-deps.cmd to download Boost. * open /project/libcec.sln with Visual C++ 2010 or Visual Studio 2010. * build the project. * copy libcec.dll and pthreadVC2.dll to your desired destination. @@ -15,7 +14,6 @@ To install libCEC on Windows: To build an installer on Windows: * download and install the Windows DDK. * download and install NSIS. -* go to /project and execute download-deps.cmd to download Boost. * go to /project and execute create-installer.cmd to create the installer. * the installer is stored as /project/libCEC-installer.exe diff --git a/configure.ac b/configure.ac index 3285c89..e146864 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libcec], 0:8:0) +AC_INIT([libcec], 1:0:0) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_PROG_CXX @@ -23,13 +23,6 @@ libs_pre_dl=$LIBS AC_SUBST([LIBS_DL]) LIBS=$libs_pre_dl -AC_LANG_PUSH([C++]) -AC_CHECK_HEADERS([boost/shared_ptr.hpp], [], - [AC_MSG_ERROR(You need the Boost libraries.)]) -AC_CHECK_HEADERS([boost/enable_shared_from_this.hpp], [], - [AC_MSG_ERROR(You need the Boost libraries.)]) -AC_LANG_POP([C++]) - CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" AC_SUBST(REQUIRES) diff --git a/debian/changelog b/debian/changelog index 570c071..dcf8ddf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +libcec (1.0-2) unstable; urgency=low + + * interface changes: + * set lib interface version back to 1.0 and rename GetLibVersion() to + GetLibVersionMajor() and GetMinVersion() to GetMinLibVersion() + * added GetLibVersionMinor()/cec_get_lib_version_minor() and set the minor + version number to 1 + * fixed: + * samsung's vendor specific remote keypresses don't send key releases. added + call to AddKey() directly after the keypress + * always reset the button press time in CLibCEC::AddKey() + * always wait for a signal in CCECProcessor::Transmit() + * changed: + * drop shared_ptr and use a normal pointer. removed boost dependency + + -- Pulse-Eight Packaging Fri, 04 Nov 2011 00:14:00 +0100 + libcec (0.8-2) unstable; urgency=low * added 'libboost-dev' to build deps diff --git a/debian/control b/debian/control index ad3d09c..5709349 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: libcec Section: video Priority: extra Maintainer: Lars Op den Kamp -Build-Depends: debhelper (>= 7), libudev-dev, mime-support, locales, gawk, autotools-dev, autoconf, automake, pkg-config, libboost-dev +Build-Depends: debhelper (>= 7), libudev-dev, mime-support, locales, gawk, autotools-dev, autoconf, automake, pkg-config Standards-Version: 3.8.3 Homepage: http://www.pulse-eight.net/ diff --git a/include/cec.h b/include/cec.h index 1701df7..19bc4d3 100644 --- a/include/cec.h +++ b/include/cec.h @@ -71,14 +71,19 @@ namespace CEC //@} /*! - * @see cec_get_min_version + * @see cec_get_min_lib_version */ - virtual int8_t GetMinVersion(void) = 0; + virtual int8_t GetMinLibVersion(void) const = 0; /*! - * @see cec_get_lib_version + * @see cec_get_lib_version_major */ - virtual int8_t GetLibVersion(void) = 0; + virtual int8_t GetLibVersionMajor(void) const = 0; + + /*! + * @see cec_get_lib_version_minor + */ + virtual int8_t GetLibVersionMinor(void) const = 0; /*! * @see cec_get_next_log_message diff --git a/include/cecc.h b/include/cecc.h index bec3920..e1c2942 100644 --- a/include/cecc.h +++ b/include/cecc.h @@ -98,12 +98,17 @@ extern DECLSPEC int cec_start_bootloader(void); /*! * @return Get the minimal version of libcec that this version of libcec can interface with. */ -extern DECLSPEC int8_t cec_get_min_version(void); +extern DECLSPEC int8_t cec_get_min_lib_version(void); /*! - * @return Get the version of libcec. + * @return Get the major version of libcec. */ -extern DECLSPEC int8_t cec_get_lib_version(void); +extern DECLSPEC int8_t cec_get_lib_version_major(void); + +/*! + * @return Get the minor version of libcec. + */ +extern DECLSPEC int8_t cec_get_lib_version_minor(void); /*! * @brief Power on the connected CEC capable devices. diff --git a/include/cectypes.h b/include/cectypes.h index 5f2edc2..a347f1b 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -738,10 +738,12 @@ typedef struct cec_vendor #define MSGEND 0xFE #define MSGESC 0xFD #define ESCOFFSET 3 -#define CEC_MIN_VERSION 8 -#define CEC_LIB_VERSION 8 #define CEC_BUTTON_TIMEOUT 500 +#define CEC_MIN_LIB_VERSION 1 +#define CEC_LIB_VERSION_MAJOR 1 +#define CEC_LIB_VERSION_MINOR 0 + #ifdef __cplusplus }; }; diff --git a/project/bin/7za.exe b/project/bin/7za.exe deleted file mode 100644 index 8836e99..0000000 Binary files a/project/bin/7za.exe and /dev/null differ diff --git a/project/bin/libeay32.dll b/project/bin/libeay32.dll deleted file mode 100644 index 8d31f86..0000000 Binary files a/project/bin/libeay32.dll and /dev/null differ diff --git a/project/bin/libiconv2.dll b/project/bin/libiconv2.dll deleted file mode 100644 index 544dd92..0000000 Binary files a/project/bin/libiconv2.dll and /dev/null differ diff --git a/project/bin/libintl3.dll b/project/bin/libintl3.dll deleted file mode 100644 index ec11e6b..0000000 Binary files a/project/bin/libintl3.dll and /dev/null differ diff --git a/project/bin/libssl32.dll b/project/bin/libssl32.dll deleted file mode 100644 index a30ff0e..0000000 Binary files a/project/bin/libssl32.dll and /dev/null differ diff --git a/project/bin/wget.exe b/project/bin/wget.exe deleted file mode 100644 index 54b372e..0000000 Binary files a/project/bin/wget.exe and /dev/null differ diff --git a/project/download-deps.cmd b/project/download-deps.cmd deleted file mode 100644 index a5ad0c6..0000000 --- a/project/download-deps.cmd +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -echo Downloading boost -bin\wget.exe "http://mirrors.xbmc.org/build-deps/win32/boost-1_46_1-xbmc-win32.7z" - -echo Extracting boost -bin\7za.exe x -y "boost-1_46_1-xbmc-win32.7z" - -echo Copying boost -xcopy boost-1_46_1-xbmc-win32\include\* "..\include\" /E /Q /I /Y - -echo Cleaning up -del boost-1_46_1-xbmc-win32.7z diff --git a/project/libcec.rc b/project/libcec.rc new file mode 100644 index 0000000..e3ede6e Binary files /dev/null and b/project/libcec.rc differ diff --git a/project/libcec.vcxproj b/project/libcec.vcxproj index 78763ce..38fc144 100644 --- a/project/libcec.vcxproj +++ b/project/libcec.vcxproj @@ -35,6 +35,7 @@ + @@ -52,6 +53,9 @@ + + + {C04B0FB1-667D-4F1C-BDAE-A07CDFFAAAA0} libcec @@ -98,6 +102,7 @@ .dll *.cdf;*.cache;*.obj;*.ilk;*.resources;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;*.tlog;*.manifest;*.res;*.pch;*.exp;*.idb;*.rep;*.xdc;*.pdb;*_manifest.rc;*.bsc;*.sbr;*.xml;*.dll $(SolutionDir)..\include;$(IncludePath) + true @@ -113,7 +118,8 @@ $(SolutionDir)..\libcec.dll %(AdditionalDependencies);setupapi.lib;$(SolutionDir)..\src\lib\platform\pthread_win32\pthreadVC2.lib libcmtd - 8 + + @@ -135,7 +141,8 @@ $(SolutionDir)..\libcec.dll %(AdditionalDependencies);setupapi.lib;$(SolutionDir)..\src\lib\platform\pthread_win32\pthreadVC2.lib libcmt - 8 + + diff --git a/project/libcec.vcxproj.filters b/project/libcec.vcxproj.filters index 1468823..699f229 100644 --- a/project/libcec.vcxproj.filters +++ b/project/libcec.vcxproj.filters @@ -82,6 +82,7 @@ devices + @@ -115,4 +116,7 @@ devices + + + \ No newline at end of file diff --git a/project/testclient.rc b/project/testclient.rc new file mode 100644 index 0000000..74ce3e6 Binary files /dev/null and b/project/testclient.rc differ diff --git a/project/testclient.vcxproj b/project/testclient.vcxproj index 68434c8..bbdb774 100644 --- a/project/testclient.vcxproj +++ b/project/testclient.vcxproj @@ -43,7 +43,7 @@ cec-client - false + true $(SolutionDir)..\ cec-client @@ -63,7 +63,8 @@ true $(ProjectDir)..\src\lib\platform\pthread_win32\pthreadVC2.lib;%(AdditionalDependencies) $(SolutionDir)..\cec-client.exe - 8 + + @@ -85,7 +86,8 @@ true true $(ProjectDir)..\src\lib\platform\pthread_win32\pthreadVC2.lib;%(AdditionalDependencies) - 8 + + @@ -95,12 +97,16 @@ + + + + diff --git a/project/testclient.vcxproj.filters b/project/testclient.vcxproj.filters index 88bab57..51b96b9 100644 --- a/project/testclient.vcxproj.filters +++ b/project/testclient.vcxproj.filters @@ -33,6 +33,9 @@ Header Files + + Header Files + @@ -45,4 +48,9 @@ Source Files + + + Resource Files + + \ No newline at end of file diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 2286a01..6614783 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -315,7 +315,6 @@ void *CAdapterCommunication::Process(void) ReadFromDevice(500); Sleep(5); WriteNextCommand(); - Sleep(5); } return NULL; @@ -353,7 +352,7 @@ void CAdapterCommunication::AddData(uint8_t *data, uint8_t iLen) void CAdapterCommunication::WriteNextCommand(void) { - CCECAdapterMessagePtr msg; + CCECAdapterMessage *msg; if (m_outBuffer.Pop(msg)) { CLockObject lock(&msg->mutex); @@ -374,7 +373,7 @@ void CAdapterCommunication::WriteNextCommand(void) } } -bool CAdapterCommunication::Write(CCECAdapterMessagePtr data) +bool CAdapterCommunication::Write(CCECAdapterMessage *data) { data->state = ADAPTER_MESSAGE_STATE_WAITING; m_outBuffer.Push(data); @@ -442,47 +441,45 @@ std::string CAdapterCommunication::GetError(void) const bool CAdapterCommunication::StartBootloader(void) { + bool bReturn(false); if (!IsRunning()) - return false; + return bReturn; m_controller->AddLog(CEC_LOG_DEBUG, "starting the bootloader"); - CCECAdapterMessagePtr output(new CCECAdapterMessage); + CCECAdapterMessage *output = new CCECAdapterMessage; output->push_back(MSGSTART); output->push_escaped(MSGCODE_START_BOOTLOADER); output->push_back(MSGEND); - if (!Write(output)) - { + if ((bReturn = Write(output)) == false) m_controller->AddLog(CEC_LOG_ERROR, "could not start the bootloader"); - return false; - } - m_controller->AddLog(CEC_LOG_DEBUG, "bootloader start command transmitted"); - return true; + + delete output; + + return bReturn; } bool CAdapterCommunication::PingAdapter(void) { + bool bReturn(false); if (!IsRunning()) - return false; + return bReturn; m_controller->AddLog(CEC_LOG_DEBUG, "sending ping"); - CCECAdapterMessagePtr output(new CCECAdapterMessage); + CCECAdapterMessage *output = new CCECAdapterMessage; output->push_back(MSGSTART); output->push_escaped(MSGCODE_PING); output->push_back(MSGEND); - if (!Write(output)) - { + if ((bReturn = Write(output)) == false) m_controller->AddLog(CEC_LOG_ERROR, "could not send ping command"); - return false; - } - - m_controller->AddLog(CEC_LOG_DEBUG, "ping tranmitted"); // TODO check for pong - return true; + delete output; + + return bReturn; } bool CAdapterCommunication::IsOpen(void) const diff --git a/src/lib/AdapterCommunication.h b/src/lib/AdapterCommunication.h index ef5e0aa..31de379 100644 --- a/src/lib/AdapterCommunication.h +++ b/src/lib/AdapterCommunication.h @@ -36,8 +36,6 @@ #include "util/buffer.h" #include "util/StdString.h" #include -#include -#include namespace CEC { @@ -51,7 +49,7 @@ namespace CEC } cec_adapter_message_state; - class CCECAdapterMessage : public boost::enable_shared_from_this + class CCECAdapterMessage { public: CCECAdapterMessage(void) { clear(); } @@ -81,7 +79,6 @@ namespace CEC CMutex mutex; CCondition condition; }; - typedef boost::shared_ptr CCECAdapterMessagePtr; class CSerialPort; class CLibCEC; @@ -94,7 +91,7 @@ namespace CEC bool Open(const char *strPort, uint16_t iBaudRate = 38400, uint32_t iTimeoutMs = 10000); bool Read(CCECAdapterMessage &msg, uint32_t iTimeout = 1000); - bool Write(CCECAdapterMessagePtr data); + bool Write(CCECAdapterMessage *data); bool PingAdapter(void); void Close(void); bool IsOpen(void) const; @@ -112,7 +109,7 @@ namespace CEC CSerialPort * m_port; CLibCEC * m_controller; CecBuffer m_inBuffer; - CecBuffer m_outBuffer; + CecBuffer m_outBuffer; CMutex m_mutex; CCondition m_rcvCondition; CCondition m_startCondition; diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 0749e53..f781b6f 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -231,13 +231,17 @@ cec_power_status CCECProcessor::GetDevicePowerStatus(cec_logical_address iAddres bool CCECProcessor::Transmit(const cec_command &data) { + bool bReturn(false); LogOutput(data); - CCECAdapterMessagePtr output(new CCECAdapterMessage(data)); - return Transmit(output); + CCECAdapterMessage *output = new CCECAdapterMessage(data); + bReturn = Transmit(output); + delete output; + + return bReturn; } -bool CCECProcessor::Transmit(CCECAdapterMessagePtr output) +bool CCECProcessor::Transmit(CCECAdapterMessage *output) { bool bReturn(false); CLockObject lock(&m_mutex); @@ -247,7 +251,7 @@ bool CCECProcessor::Transmit(CCECAdapterMessagePtr output) return bReturn; else { - output->condition.Wait(&output->mutex, 1000); + output->condition.Wait(&output->mutex); if (output->state != ADAPTER_MESSAGE_STATE_SENT) { m_controller->AddLog(CEC_LOG_ERROR, "command was not sent"); @@ -390,6 +394,11 @@ void CCECProcessor::AddCommand(const cec_command &command) m_controller->AddCommand(command); } +void CCECProcessor::AddKey(cec_keypress &key) +{ + m_controller->AddKey(key); +} + void CCECProcessor::AddKey(void) { m_controller->AddKey(); @@ -402,11 +411,12 @@ void CCECProcessor::AddLog(cec_log_level level, const CStdString &strMessage) bool CCECProcessor::SetAckMask(uint16_t iMask) { + bool bReturn(false); CStdString strLog; strLog.Format("setting ackmask to %2x", iMask); m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str()); - CCECAdapterMessagePtr output(new CCECAdapterMessage); + CCECAdapterMessage *output = new CCECAdapterMessage; output->push_back(MSGSTART); output->push_escaped(MSGCODE_SET_ACK_MASK); @@ -414,11 +424,10 @@ bool CCECProcessor::SetAckMask(uint16_t iMask) output->push_escaped((uint8_t)iMask); output->push_back(MSGEND); - if (!Transmit(output)) - { + if ((bReturn = Transmit(output)) == false) m_controller->AddLog(CEC_LOG_ERROR, "could not set the ackmask"); - return false; - } - return true; + delete output; + + return bReturn; } diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index e2793a3..d865167 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -70,11 +70,12 @@ namespace CEC virtual bool SwitchMonitoring(bool bEnable); virtual bool Transmit(const cec_command &data); - virtual bool Transmit(CCECAdapterMessagePtr output); + virtual bool Transmit(CCECAdapterMessage *output); virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE); virtual void SetCurrentButton(cec_user_control_code iButtonCode); virtual void AddCommand(const cec_command &command); + virtual void AddKey(cec_keypress &key); virtual void AddKey(void); virtual void AddLog(cec_log_level level, const CStdString &strMessage); diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index ed60f43..95e2a2e 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -55,14 +55,7 @@ CLibCEC::~CLibCEC(void) { Close(); delete m_cec; - m_cec = NULL; - delete m_comm; - m_comm = NULL; - - m_logBuffer.Clear(); - m_keyBuffer.Clear(); - m_commandBuffer.Clear(); } bool CLibCEC::Open(const char *strPort, uint32_t iTimeoutMs /* = 10000 */) @@ -134,16 +127,6 @@ bool CLibCEC::StartBootloader(void) return m_comm ? m_comm->StartBootloader() : false; } -int8_t CLibCEC::GetMinVersion(void) -{ - return CEC_MIN_VERSION; -} - -int8_t CLibCEC::GetLibVersion(void) -{ - return CEC_LIB_VERSION; -} - bool CLibCEC::GetNextLogMessage(cec_log_message *message) { return (m_logBuffer.Pop(*message)); @@ -244,6 +227,13 @@ void CLibCEC::AddLog(cec_log_level level, const string &strMessage) } } +void CLibCEC::AddKey(cec_keypress &key) +{ + m_keyBuffer.Push(key); + m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; + m_buttontime = 0; +} + void CLibCEC::AddKey(void) { if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) @@ -254,8 +244,8 @@ void CLibCEC::AddKey(void) key.keycode = m_iCurrentButton; m_keyBuffer.Push(key); m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; - m_buttontime = 0; } + m_buttontime = 0; } void CLibCEC::AddCommand(const cec_command &command) diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index 391148d..0b43aa4 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -56,8 +56,9 @@ namespace CEC virtual bool PingAdapter(void); virtual bool StartBootloader(void); - virtual int8_t GetMinVersion(void); - virtual int8_t GetLibVersion(void); + virtual int8_t GetMinLibVersion(void) const{ return CEC_MIN_LIB_VERSION; }; + virtual int8_t GetLibVersionMajor(void) const { return CEC_LIB_VERSION_MAJOR; }; + virtual int8_t GetLibVersionMinor(void) const { return CEC_LIB_VERSION_MINOR; }; virtual bool GetNextLogMessage(cec_log_message *message); virtual bool GetNextKeypress(cec_keypress *key); @@ -81,6 +82,7 @@ namespace CEC virtual void AddLog(cec_log_level level, const std::string &strMessage); virtual void AddKey(void); + virtual void AddKey(cec_keypress &key); virtual void AddCommand(const cec_command &command); virtual void CheckKeypressTimeout(void); virtual void SetCurrentButton(cec_user_control_code iButtonCode); diff --git a/src/lib/LibCECC.cpp b/src/lib/LibCECC.cpp index 28a268b..a3be5f3 100644 --- a/src/lib/LibCECC.cpp +++ b/src/lib/LibCECC.cpp @@ -92,14 +92,21 @@ int cec_start_bootloader(void) int8_t cec_get_min_version(void) { if (cec_parser) - return cec_parser->GetMinVersion(); + return cec_parser->GetMinLibVersion(); return -1; } -int8_t cec_get_lib_version(void) +int8_t cec_get_lib_version_major(void) { if (cec_parser) - return cec_parser->GetLibVersion(); + return cec_parser->GetLibVersionMajor(); + return -1; +} + +int8_t cec_get_lib_version_minor(void) +{ + if (cec_parser) + return cec_parser->GetLibVersionMinor(); return -1; } diff --git a/src/lib/implementations/ANCommandHandler.cpp b/src/lib/implementations/ANCommandHandler.cpp index 394cfa9..f1e3dd5 100644 --- a/src/lib/implementations/ANCommandHandler.cpp +++ b/src/lib/implementations/ANCommandHandler.cpp @@ -46,25 +46,26 @@ bool CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command) { if (command.parameters.size > 0) { - m_busDevice->GetProcessor()->AddKey(); + cec_keypress key; + key.duration = CEC_BUTTON_TIMEOUT; + key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; - uint8_t iButton = 0; switch (command.parameters[0]) { case CEC_AN_USER_CONTROL_CODE_RETURN: - iButton = CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL; + key.keycode = CEC_USER_CONTROL_CODE_EXIT; break; default: break; } - if (iButton > 0 && iButton <= CEC_USER_CONTROL_CODE_MAX) + if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) { CStdString strLog; - strLog.Format("key pressed: %1x", iButton); + strLog.Format("key pressed: %1x", key.keycode); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog); - m_busDevice->GetProcessor()->SetCurrentButton((cec_user_control_code) command.parameters[0]); + m_busDevice->GetProcessor()->AddKey(key); } } diff --git a/src/lib/platform/linux/serialport.cpp b/src/lib/platform/linux/serialport.cpp index e362396..56bdc30 100644 --- a/src/lib/platform/linux/serialport.cpp +++ b/src/lib/platform/linux/serialport.cpp @@ -46,7 +46,7 @@ CSerialPort::~CSerialPort() Close(); } -int8_t CSerialPort::Write(CCECAdapterMessagePtr data) +int8_t CSerialPort::Write(CCECAdapterMessage *data) { fd_set port; diff --git a/src/lib/platform/serialport.h b/src/lib/platform/serialport.h index 4fb2954..a88ebec 100644 --- a/src/lib/platform/serialport.h +++ b/src/lib/platform/serialport.h @@ -47,7 +47,7 @@ namespace CEC bool IsOpen(); void Close(); - int8_t Write(CCECAdapterMessagePtr data); + int8_t Write(CCECAdapterMessage *data); int32_t Read(uint8_t* data, uint32_t len, uint64_t iTimeoutMs = 0); std::string GetError() { return m_error; } diff --git a/src/lib/platform/windows/serialport.cpp b/src/lib/platform/windows/serialport.cpp index b028ff3..df619ef 100644 --- a/src/lib/platform/windows/serialport.cpp +++ b/src/lib/platform/windows/serialport.cpp @@ -166,7 +166,7 @@ void CSerialPort::Close(void) } } -int8_t CSerialPort::Write(CCECAdapterMessagePtr data) +int8_t CSerialPort::Write(CCECAdapterMessage *data) { CLockObject lock(&m_mutex); DWORD iBytesWritten = 0; diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index d30d982..8efffed 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -44,7 +44,7 @@ using namespace CEC; using namespace std; -#define CEC_TEST_CLIENT_VERSION 8 +#define CEC_TEST_CLIENT_VERSION 1 #include @@ -245,7 +245,7 @@ void show_console_help(void) int main (int argc, char *argv[]) { ICECAdapter *parser = LoadLibCec("CECTester"); - if (!parser || parser->GetMinVersion() > CEC_TEST_CLIENT_VERSION) + if (!parser || parser->GetMinLibVersion() > CEC_TEST_CLIENT_VERSION) { #ifdef __WINDOWS__ cout << "Cannot load libcec.dll" << endl; @@ -255,7 +255,7 @@ int main (int argc, char *argv[]) return 1; } CStdString strLog; - strLog.Format("CEC Parser created - libcec version %d", parser->GetLibVersion()); + strLog.Format("CEC Parser created - libcec version %d.%d", parser->GetLibVersionMajor(), parser->GetLibVersionMinor()); cout << strLog.c_str() << endl; //make stdin non-blocking