- virtual bool Start(const char *strPort, uint16_t iBaudRate = 38400, uint32_t iTimeoutMs = 10000);
- virtual void *Process(void);
-
- virtual bool IsMonitoring(void) const { return m_bMonitor; }
- virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh = false) const;
- virtual CCECBusDevice * GetDeviceByType(cec_device_type type) const;
- virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
- virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
- virtual const std::string & GetDeviceName(void) { return m_strDeviceName; }
- virtual cec_osd_name GetDeviceOSDName(cec_logical_address iAddress);
- virtual uint64_t GetDeviceVendorId(cec_logical_address iAddress);
- virtual cec_power_status GetDevicePowerStatus(cec_logical_address iAddress);
- virtual cec_logical_address GetLogicalAddress(void) const { return m_logicalAddresses.primary; }
- virtual cec_logical_addresses GetLogicalAddresses(void) const { return m_logicalAddresses; }
- virtual cec_logical_addresses GetActiveDevices(void);
- virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
- virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); }
- virtual bool IsActiveDevice(cec_logical_address address);
- virtual bool IsActiveDeviceType(cec_device_type type);
- virtual uint16_t GetPhysicalAddress(void) const;
- virtual uint64_t GetLastTransmission(void) const { return m_iLastTransmission; }
- virtual bool IsStarted(void) const { return m_bStarted; }
- virtual cec_logical_address GetActiveSource(void);
- virtual bool IsActiveSource(cec_logical_address iAddress);
-
- virtual bool SetActiveView(void);
- virtual bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED);
- virtual bool SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate = true);
- virtual bool SetDeckInfo(cec_deck_info info, bool bSendUpdate = true);
- virtual bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, bool bForce = false);
- virtual bool TransmitInactiveSource(void);
- virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
- 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(void);
- virtual uint8_t VolumeDown(void);
- virtual uint8_t MuteAudio(void);
- virtual bool TransmitKeypress(cec_logical_address iDestination, cec_user_control_code key);
- virtual bool TransmitKeyRelease(cec_logical_address iDestination);
- virtual bool EnablePhysicalAddressDetection(void) { return false; };
+ bool Start(const char *strPort, uint16_t iBaudRate = CEC_SERIAL_DEFAULT_BAUDRATE, uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT);
+ void *Process(void);
+ void Close(void);
+
+ bool OnCommandReceived(const cec_command &command);
+
+ bool IsMonitoring(void) const { return m_bMonitor; }
+ CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bSuppressUpdate = true);
+ CCECBusDevice * GetDeviceByType(cec_device_type type) const;
+ CCECBusDevice * GetPrimaryDevice(void) const;
+ cec_version GetDeviceCecVersion(cec_logical_address iAddress);
+ bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
+ CStdString GetDeviceName(void) const;
+ cec_osd_name GetDeviceOSDName(cec_logical_address iAddress);
+ uint64_t GetDeviceVendorId(cec_logical_address iAddress);
+ cec_power_status GetDevicePowerStatus(cec_logical_address iAddress);
+ cec_logical_address GetLogicalAddress(void) const { return m_configuration.logicalAddresses.primary; }
+ cec_logical_addresses GetLogicalAddresses(void) const { return m_configuration.logicalAddresses; }
+ cec_logical_addresses GetActiveDevices(void);
+ uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
+ bool HasLogicalAddress(cec_logical_address address) const { return m_configuration.logicalAddresses.IsSet(address); }
+ bool IsPresentDevice(cec_logical_address address);
+ bool IsPresentDeviceType(cec_device_type type);
+ uint16_t GetPhysicalAddress(void) const;
+ uint64_t GetLastTransmission(void) const { return m_iLastTransmission; }
+ cec_logical_address GetActiveSource(bool bRequestActiveSource = true);
+ bool IsActiveSource(cec_logical_address iAddress);
+ bool IsInitialised(void);
+ bool SetStreamPath(uint16_t iPhysicalAddress);
+ cec_client_version GetClientVersion(void) const { return (cec_client_version)m_configuration.clientVersion; };
+ bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST);
+ bool PowerOnDevices(cec_logical_address address = CECDEVICE_BROADCAST);
+
+ bool SetActiveView(void);
+ bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED);
+ bool SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate = true);
+ bool SetDeckInfo(cec_deck_info info, bool bSendUpdate = true);
+ bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, bool bForce = false);
+ bool TransmitInactiveSource(void);
+ bool SetLogicalAddress(cec_logical_address iLogicalAddress);
+ bool SetMenuState(cec_menu_state state, bool bSendUpdate = true);
+ bool SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpdate = true);
+ bool SetActiveSource(uint16_t iStreamPath);
+ bool SwitchMonitoring(bool bEnable);
+ bool PollDevice(cec_logical_address iAddress);
+ uint8_t VolumeUp(bool bSendRelease = true);
+ uint8_t VolumeDown(bool bSendRelease = true);
+ uint8_t MuteAudio(bool bSendRelease = true);
+ bool TransmitKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = true);
+ bool TransmitKeyRelease(cec_logical_address iDestination, bool bWait = true);
+ bool EnablePhysicalAddressDetection(void);