X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FUSBCECAdapterCommunication.h;h=5db5a1a0674310a9b4fe94a9fc517fe211eea94f;hb=e69d8f191784c77c156ffec90db50767f91421e3;hp=e33413e933d8f2777ab1a99c16a65cc22f7f5203;hpb=d4db0c6f1121a5e43c98255af5202ebd33f2b800;p=deb_libcec.git diff --git a/src/lib/adapter/USBCECAdapterCommunication.h b/src/lib/adapter/USBCECAdapterCommunication.h index e33413e..5db5a1a 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.h +++ b/src/lib/adapter/USBCECAdapterCommunication.h @@ -67,7 +67,7 @@ namespace CEC { public: CUSBCECAdapterCommunication(CCECProcessor *processor, const char *strPort, uint16_t iBaudRate = 38400); - virtual ~CUSBCECAdapterCommunication(); + virtual ~CUSBCECAdapterCommunication() {}; virtual bool Open(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000, bool bSkipChecks = false); virtual void Close(void); @@ -84,21 +84,36 @@ namespace CEC virtual uint16_t GetFirmwareVersion(void); virtual bool SetControlledMode(bool controlled); virtual bool PersistConfiguration(libcec_configuration *configuration); + virtual bool GetConfiguration(libcec_configuration *configuration); virtual CStdString GetPortName(void); virtual uint16_t GetPhysicalAddress(void) { return 0; } void *Process(void); private: - bool SendCommand(cec_adapter_messagecode msgCode, CCECAdapterMessage ¶ms, bool bExpectAck = true, bool bIsTransmission = false, bool bSendDirectly = true); - cec_datapacket GetSetting(cec_adapter_messagecode msgCode); - - bool SetAutoEnabled(bool enabled); - bool SetDeviceType(cec_device_type type); - bool SetDefaultLogicalAddress(cec_logical_address address); - bool SetLogicalAddressMask(uint16_t iMask); - bool SetPhysicalAddress(uint16_t iPhysicalAddress); - bool SetCECVersion(cec_version version); - bool SetOSDName(const char *strOSDName); + bool SendCommand(cec_adapter_messagecode msgCode, CCECAdapterMessage ¶ms, bool bExpectAck = true, bool bIsTransmission = false, bool bSendDirectly = true, bool bIsRetry = false); + cec_datapacket GetSetting(cec_adapter_messagecode msgCode, uint8_t iResponseLength); + + bool SetSettingAutoEnabled(bool enabled); + bool GetSettingAutoEnabled(bool &enabled); + + bool SetSettingDeviceType(cec_device_type type); + bool GetSettingDeviceType(cec_device_type &type); + + bool SetSettingDefaultLogicalAddress(cec_logical_address address); + bool GetSettingDefaultLogicalAddress(cec_logical_address &address); + + bool SetSettingLogicalAddressMask(uint16_t iMask); + bool GetSettingLogicalAddressMask(uint16_t &iMask); + + bool SetSettingPhysicalAddress(uint16_t iPhysicalAddress); + bool GetSettingPhysicalAddress(uint16_t &iPhysicalAddress); + + bool SetSettingCECVersion(cec_version version); + bool GetSettingCECVersion(cec_version &version); + + bool SetSettingOSDName(const char *strOSDName); + bool GetSettingOSDName(CStdString &strOSDName); + bool WriteEEPROM(void); bool SetAckMaskInternal(uint16_t iMask, bool bWriteDirectly = false); @@ -123,12 +138,13 @@ namespace CEC uint8_t m_iLineTimeout; uint16_t m_iFirmwareVersion; cec_command m_currentframe; - cec_logical_address m_lastInitiator; + cec_logical_address m_lastDestination; CCECAdapterMessage m_currentAdapterMessage; bool m_bNextIsEscaped; bool m_bGotStart; IAdapterCommunicationCallback * m_callback; CUSBCECAdapterProcessor * m_messageProcessor; bool m_bInitialised; + bool m_bWaitingForAck[15]; }; };