From: Lars Op den Kamp Date: Thu, 3 Nov 2011 19:25:36 +0000 (+0100) Subject: cec: added GetLibVersionMinor()/cec_get_lib_version_minor() and set the minor version... X-Git-Tag: upstream/2.2.0~1^2~126 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=eafd9beda6b5e5aafaccd7a0e3de65c632d494e0;p=deb_libcec.git cec: added GetLibVersionMinor()/cec_get_lib_version_minor() and set the minor version number to 1 --- diff --git a/include/cec.h b/include/cec.h index 1701df7..5ef2026 100644 --- a/include/cec.h +++ b/include/cec.h @@ -80,6 +80,11 @@ namespace CEC */ virtual int8_t GetLibVersion(void) = 0; + /*! + * @see cec_get_lib_version + */ + virtual int8_t GetLibVersionMinor(void) = 0; + /*! * @see cec_get_next_log_message */ diff --git a/include/cecc.h b/include/cecc.h index bec3920..8ca688c 100644 --- a/include/cecc.h +++ b/include/cecc.h @@ -105,6 +105,11 @@ extern DECLSPEC int8_t cec_get_min_version(void); */ extern DECLSPEC int8_t cec_get_lib_version(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. * @param address The logical address to power on. diff --git a/include/cectypes.h b/include/cectypes.h index 5f2edc2..188e7de 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -738,9 +738,11 @@ typedef struct cec_vendor #define MSGEND 0xFE #define MSGESC 0xFD #define ESCOFFSET 3 +#define CEC_BUTTON_TIMEOUT 500 + #define CEC_MIN_VERSION 8 #define CEC_LIB_VERSION 8 -#define CEC_BUTTON_TIMEOUT 500 +#define CEC_LIB_VERSION_MINOR 1 #ifdef __cplusplus }; diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index 13e1c11..0efef00 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -127,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)); diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index 391148d..203facb 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 GetMinVersion(void) { return CEC_MIN_VERSION; }; + virtual int8_t GetLibVersion(void) { return CEC_LIB_VERSION; }; + virtual int8_t GetLibVersionMinor(void) { return CEC_LIB_VERSION_MINOR; }; virtual bool GetNextLogMessage(cec_log_message *message); virtual bool GetNextKeypress(cec_keypress *key); diff --git a/src/lib/LibCECC.cpp b/src/lib/LibCECC.cpp index 28a268b..b792044 100644 --- a/src/lib/LibCECC.cpp +++ b/src/lib/LibCECC.cpp @@ -103,6 +103,13 @@ int8_t cec_get_lib_version(void) return -1; } +int8_t cec_get_lib_version_minor(void) +{ + if (cec_parser) + return cec_parser->GetLibVersionMinor(); + return -1; +} + int cec_get_next_log_message(cec_log_message *message) { if (cec_parser) diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index d30d982..b57491a 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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->GetLibVersion(), parser->GetLibVersionMinor()); cout << strLog.c_str() << endl; //make stdin non-blocking