X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.h;h=44f1fc170bf1d22d674e7d057c44fa4024b5afb6;hb=f7539eaf1ed0a488c0a93998c9b178d435014c51;hp=5aa532b07a2db66e51986ee6f042ce100e8afd94;hpb=f8edb2973d37f3ebfd08291f28be5435d0cf8f64;p=deb_libcec.git diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index 5aa532b..44f1fc1 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -2,7 +2,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -51,6 +51,19 @@ namespace CEC class CCECTuner; class CCECTV; class CCECClient; + class CCECProcessor; + class CCECStandbyProtection; + + class CCECAllocateLogicalAddress : public PLATFORM::CThread + { + public: + CCECAllocateLogicalAddress(CCECProcessor* processor, CCECClient* client); + void* Process(void); + + private: + CCECProcessor* m_processor; + CCECClient* m_client; + }; class CCECProcessor : public PLATFORM::CThread, public IAdapterCommunicationCallback { @@ -65,10 +78,13 @@ namespace CEC bool RegisterClient(CCECClient *client); bool UnregisterClient(CCECClient *client); void UnregisterClients(void); + uint16_t GetPhysicalAddressFromEeprom(void); CCECClient *GetPrimaryClient(void); CCECClient *GetClient(const cec_logical_address address); bool OnCommandReceived(const cec_command &command); + void HandleLogicalAddressLost(cec_logical_address oldAddress); + void HandlePhysicalAddressChanged(uint16_t iNewAddress); CCECBusDevice * GetDevice(cec_logical_address address) const; CCECAudioSystem * GetAudioSystem(void) const; @@ -96,6 +112,7 @@ namespace CEC bool SetDeckInfo(cec_deck_info info, bool bSendUpdate = true); bool ActivateSource(uint16_t iStreamPath); + void SetActiveSource(bool bSetTo, bool bClientUnregistered); bool PollDevice(cec_logical_address iAddress); void SetStandardLineTimeout(uint8_t iTimeout); uint8_t GetStandardLineTimeout(void); @@ -127,7 +144,13 @@ namespace CEC bool TryLogicalAddress(cec_logical_address address, cec_version libCECSpecVersion = CEC_VERSION_1_4); bool IsRunningLatestFirmware(void); - private: + void SwitchMonitoring(bool bSwitchTo); + + bool AllocateLogicalAddresses(CCECClient* client); + + uint16_t GetAdapterVendorId(void) const; + uint16_t GetAdapterProductId(void) const; + private: bool OpenConnection(const char *strPort, uint16_t iBaudRate, uint32_t iTimeoutMs, bool bStartListening = true); void SetCECInitialised(bool bSetTo = true); @@ -152,5 +175,20 @@ namespace CEC CCECInputBuffer m_inBuffer; CCECDeviceMap * m_busDevices; std::map m_clients; + bool m_bMonitor; + CCECAllocateLogicalAddress* m_addrAllocator; + bool m_bStallCommunication; + CCECStandbyProtection* m_connCheck; + }; + + class CCECStandbyProtection : public PLATFORM::CThread + { + public: + CCECStandbyProtection(CCECProcessor* processor); + virtual ~CCECStandbyProtection(void); + void* Process(void); + + private: + CCECProcessor* m_processor; }; };