From: Lars Op den Kamp Date: Wed, 15 Feb 2012 18:38:14 +0000 (+0100) Subject: cec: added GetPortName() to CUSBCECAdapterCommunication X-Git-Tag: upstream/2.2.0~1^2~35^2~38 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cba904a6dc0be488b9e761861f752653ec5e6801;p=deb_libcec.git cec: added GetPortName() to CUSBCECAdapterCommunication --- diff --git a/src/lib/adapter/AdapterCommunication.h b/src/lib/adapter/AdapterCommunication.h index c169e16..98ecd2e 100644 --- a/src/lib/adapter/AdapterCommunication.h +++ b/src/lib/adapter/AdapterCommunication.h @@ -143,5 +143,10 @@ namespace CEC * @return True when the configuration was persisted, false otherwise. */ virtual bool PersistConfiguration(libcec_configuration *configuration) = 0; + + /*! + * @return The name of the port + */ + virtual CStdString GetPortName(void) = 0; }; }; diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index e5cedb8..7037c78 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -707,3 +707,10 @@ void CUSBCECAdapterCommunication::WriteNextCommand(void) if (m_outBuffer.Pop(msg)) SendMessageToAdapter(msg); } + +CStdString CUSBCECAdapterCommunication::GetPortName(void) +{ + CStdString strName; + strName = m_port->GetName(); + return strName; +} diff --git a/src/lib/adapter/USBCECAdapterCommunication.h b/src/lib/adapter/USBCECAdapterCommunication.h index d2de30e..3a9ba51 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.h +++ b/src/lib/adapter/USBCECAdapterCommunication.h @@ -67,6 +67,7 @@ namespace CEC virtual uint16_t GetFirmwareVersion(void); virtual bool SetControlledMode(bool controlled); virtual bool PersistConfiguration(libcec_configuration * UNUSED(configuration)) { return false; } // TODO + virtual CStdString GetPortName(void); void *Process(void); private: