3 * This file is part of the libCEC(R) library.
5 * libCEC Exynos Code is Copyright (C) 2014 Valentin Manea
6 * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
7 * libCEC(R) is an original work, containing original code.
9 * libCEC(R) is a trademark of Pulse-Eight Limited.
11 * This program is dual-licensed; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * Alternatively, you can license this library under a commercial license,
27 * please contact Pulse-Eight Licensing for more information.
29 * For more information contact:
30 * Pulse-Eight Licensing <license@pulse-eight.com>
31 * http://www.pulse-eight.com/
32 * http://www.pulse-eight.net/
35 #if defined(HAVE_EXYNOS_API)
37 #include "lib/platform/threads/mutex.h"
38 #include "lib/platform/threads/threads.h"
39 #include "lib/adapter/AdapterCommunication.h"
44 class CExynosCECAdapterCommunication
: public IAdapterCommunication
, public PLATFORM::CThread
48 * @brief Create a new Exynos HDMI CEC communication handler.
49 * @param callback The callback to use for incoming CEC commands.
51 CExynosCECAdapterCommunication(IAdapterCommunicationCallback
*callback
);
52 virtual ~CExynosCECAdapterCommunication(void);
54 /** @name IAdapterCommunication implementation */
56 bool Open(uint32_t iTimeoutMs
= CEC_DEFAULT_CONNECT_TIMEOUT
, bool bSkipChecks
= false, bool bStartListening
= true);
59 std::string
GetError(void) const;
60 cec_adapter_message_state
Write(const cec_command
&data
, bool &bRetry
, uint8_t iLineTimeout
, bool bIsReply
);
62 bool SetLineTimeout(uint8_t UNUSED(iTimeout
)) { return true; }
63 bool StartBootloader(void) { return false; }
64 bool SetLogicalAddresses(const cec_logical_addresses
&addresses
);
65 cec_logical_addresses
GetLogicalAddresses(void);
66 bool PingAdapter(void) { return IsInitialised(); }
67 uint16_t GetFirmwareVersion(void);
68 uint32_t GetFirmwareBuildDate(void) { return 0; }
69 bool IsRunningLatestFirmware(void) { return true; }
70 bool PersistConfiguration(const libcec_configuration
& UNUSED(configuration
)) { return false; }
71 bool GetConfiguration(libcec_configuration
& UNUSED(configuration
)) { return false; }
72 std::string
GetPortName(void) { return std::string("EXYNOS"); }
73 uint16_t GetPhysicalAddress(void);
74 bool SetControlledMode(bool UNUSED(controlled
)) { return true; }
75 cec_vendor_id
GetVendorId(void);
76 bool SupportsSourceLogicalAddress(const cec_logical_address address
) { return address
> CECDEVICE_TV
&& address
<= CECDEVICE_BROADCAST
; }
77 cec_adapter_type
GetAdapterType(void) { return ADAPTERTYPE_EXYNOS
; }
78 uint16_t GetAdapterVendorId(void) const { return 1; }
79 uint16_t GetAdapterProductId(void) const { return 1; }
80 void HandleLogicalAddressLost(cec_logical_address oldAddress
);
81 void SetActiveSource(bool UNUSED(bSetTo
), bool UNUSED(bClientUnregistered
)) {}
84 /** @name PLATFORM::CThread implementation */
90 bool IsInitialised(void) const { return 1; };
92 std::string m_strError
; /**< current error message */
94 bool m_bLogicalAddressChanged
;
95 cec_logical_addresses m_logicalAddresses
;
97 PLATFORM::CMutex m_mutex
;