From: Lars Op den Kamp Date: Sun, 2 Oct 2011 19:30:03 +0000 (+0200) Subject: cec: change the default argument of PowerOnDevices() to CECDEVICE_TV. deprecate Power... X-Git-Tag: upstream/2.2.0~1^2~308 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8148859ed1d46a20c30a953db91ccbbd127c85e9;p=deb_libcec.git cec: change the default argument of PowerOnDevices() to CECDEVICE_TV. deprecate PowerOffDevices(). use StandbyDevices() instead --- diff --git a/include/CECExportsC.h b/include/CECExportsC.h index 8d91fe2..f76e2f3 100644 --- a/include/CECExportsC.h +++ b/include/CECExportsC.h @@ -79,9 +79,7 @@ extern DECLSPEC bool cec_ping(void); extern DECLSPEC bool cec_start_bootloader(void); /*! - * @brief Power off connected CEC capable devices. - * @param address The logical address to power off. - * @return True when the command was sent succesfully, false otherwise. + * @depcrecated Use cec_standby_devices() instead */ #ifdef __cplusplus extern DECLSPEC bool cec_power_off_devices(CEC::cec_logical_address address = CEC::CECDEVICE_BROADCAST); @@ -95,9 +93,9 @@ extern DECLSPEC bool cec_power_off_devices(cec_logical_address address = CECDEVI * @return True when the command was sent succesfully, false otherwise. */ #ifdef __cplusplus -extern DECLSPEC bool cec_power_on_devices(CEC::cec_logical_address address = CEC::CECDEVICE_BROADCAST); +extern DECLSPEC bool cec_power_on_devices(CEC::cec_logical_address address = CEC::CECDEVICE_TV); #else -extern DECLSPEC bool cec_power_on_devices(cec_logical_address address = CECDEVICE_BROADCAST); +extern DECLSPEC bool cec_power_on_devices(cec_logical_address address = CECDEVICE_TV); #endif /*! diff --git a/include/CECExportsCpp.h b/include/CECExportsCpp.h index ac00190..4f40bfe 100644 --- a/include/CECExportsCpp.h +++ b/include/CECExportsCpp.h @@ -62,7 +62,7 @@ namespace CEC virtual bool StartBootloader(void) = 0; /*! - * @see cec_power_off_devices + * @depcrecated Use StandbyDevices() instead */ virtual bool PowerOffDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0; diff --git a/src/lib/CECParser.cpp b/src/lib/CECParser.cpp index dad7a0d..8273137 100644 --- a/src/lib/CECParser.cpp +++ b/src/lib/CECParser.cpp @@ -217,19 +217,10 @@ uint8_t CCECParser::GetSourceDestination(cec_logical_address destination /* = CE bool CCECParser::PowerOffDevices(cec_logical_address address /* = CECDEVICE_BROADCAST */) { - if (!m_bRunning) - return false; - - CStdString strLog; - strLog.Format("powering off devices with logical address %d", (int8_t)address); - AddLog(CEC_LOG_DEBUG, strLog.c_str()); - cec_frame frame; - frame.push_back(GetSourceDestination(address)); - frame.push_back(CEC_OPCODE_STANDBY); - return Transmit(frame); + return StandbyDevices(address); } -bool CCECParser::PowerOnDevices(cec_logical_address address /* = CECDEVICE_BROADCAST */) +bool CCECParser::PowerOnDevices(cec_logical_address address /* = CECDEVICE_TV */) { if (!m_bRunning) return false; diff --git a/src/lib/CECParser.h b/src/lib/CECParser.h index be95855..ef39cfb 100644 --- a/src/lib/CECParser.h +++ b/src/lib/CECParser.h @@ -57,7 +57,7 @@ namespace CEC virtual bool Ping(void); virtual bool StartBootloader(void); virtual bool PowerOffDevices(cec_logical_address address = CECDEVICE_BROADCAST); - virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_BROADCAST); + virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_TV); virtual bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST); virtual bool SetActiveView(void); virtual bool SetInactiveView(void);