- protected:
- virtual bool TransmitFormatted(const cec_frame &data, bool bWaitForAck = true);
- virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE);
- virtual void ReportCECVersion(cec_logical_address address = CECDEVICE_TV);
- virtual void ReportPowerState(cec_logical_address address = CECDEVICE_TV, bool bOn = true);
- virtual void ReportMenuState(cec_logical_address address = CECDEVICE_TV, bool bActive = true);
- virtual void ReportVendorID(cec_logical_address address = CECDEVICE_TV);
- virtual void ReportOSDName(cec_logical_address address = CECDEVICE_TV);
- virtual void ReportPhysicalAddress(void);
- virtual void BroadcastActiveSource(void);
- virtual uint8_t GetSourceDestination(cec_logical_address destination = CECDEVICE_BROADCAST) const;
-
- private:
- bool WaitForAck(uint32_t iTimeout = 1000);
- bool ParseMessage(cec_frame &msg);
- void ParseCurrentFrame(void);
-
- cec_frame m_currentframe;
- uint16_t m_physicaladdress;
- cec_logical_address m_iLogicalAddress;
- CecBuffer<cec_frame> m_frameBuffer;
- std::string m_strDeviceName;
- CMutex m_mutex;
- CAdapterCommunication *m_communication;
- CLibCEC *m_controller;
+ virtual bool SetMenuState(cec_menu_state state, bool bSendUpdate = true);
+ virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress);
+ virtual bool SetStreamPath(uint16_t iStreamPath);
+ virtual bool SwitchMonitoring(bool bEnable);
+ virtual bool PollDevice(cec_logical_address iAddress);
+ virtual uint8_t VolumeUp(bool bWait = true);
+ virtual uint8_t VolumeDown(bool bWait = true);
+ virtual uint8_t MuteAudio(bool bWait = true);
+ virtual bool SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = false);
+ virtual bool SendKeyRelease(cec_logical_address iDestination, bool bWait = false);
+ virtual bool EnablePhysicalAddressDetection(void) { return false; };
+
+ bool SetLineTimeout(uint8_t iTimeout);
+
+ const char *ToString(const cec_menu_state state);
+ const char *ToString(const cec_version version);
+ const char *ToString(const cec_power_status status);
+ const char *ToString(const cec_logical_address address);
+ const char *ToString(const cec_deck_control_mode mode);
+ const char *ToString(const cec_deck_info status);
+ const char *ToString(const cec_opcode opcode);
+ const char *ToString(const cec_system_audio_status mode);
+ const char *ToString(const cec_audio_status status);
+ const char *ToString(const cec_vendor_id vendor);
+
+ virtual bool Transmit(const cec_command &data);
+ virtual bool Transmit(CCECAdapterMessage *output);
+ virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, cec_abort_reason 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);
+
+ virtual bool FindLogicalAddresses(void);
+ virtual bool SetAckMask(uint16_t iMask);
+
+ virtual bool StartBootloader(void);
+ virtual bool PingAdapter(void);
+
+ CCECBusDevice *m_busDevices[16];
+
+ private:
+ void ScanCECBus(void);
+ bool CheckPhysicalAddress(uint16_t iPhysicalAddress);
+ bool TryLogicalAddress(cec_logical_address address);
+ bool FindLogicalAddressRecordingDevice(void);
+ bool FindLogicalAddressTuner(void);
+ bool FindLogicalAddressPlaybackDevice(void);
+ bool FindLogicalAddressAudioSystem(void);
+
+ void LogOutput(const cec_command &data);
+ bool WaitForTransmitSucceeded(CCECAdapterMessage *message);
+ bool ParseMessage(const CCECAdapterMessage &msg);
+ void ParseCommand(cec_command &command);
+
+ bool m_bStarted;
+ uint8_t m_iHDMIPort;
+ cec_logical_address m_iBaseDevice;
+ cec_command m_currentframe;
+ cec_logical_addresses m_logicalAddresses;
+ cec_logical_address m_lastInitiator;
+ std::string m_strDeviceName;
+ cec_device_type_list m_types;
+ CMutex m_mutex;
+ CCondition m_startCondition;
+ CAdapterCommunication* m_communication;
+ CLibCEC* m_controller;
+ bool m_bMonitor;
+ CecBuffer<cec_command> m_commandBuffer;
+ cec_keypress m_previousKey;
+ CThread * m_busScan;
+ uint8_t m_iLineTimeout;
+ };
+
+ class CCECBusScan : public CThread
+ {
+ public:
+ CCECBusScan(CCECProcessor *processor) { m_processor = processor; }
+ virtual ~CCECBusScan(void) {}
+ virtual void *Process(void);
+
+ private:
+ CCECProcessor *m_processor;