3 * This file is part of the libCEC(R) library.
5 * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
6 * libCEC(R) is an original work, containing original code.
8 * libCEC(R) is a trademark of Pulse-Eight Limited.
10 * This program is dual-licensed; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * Alternatively, you can license this library under a commercial license,
26 * please contact Pulse-Eight Licensing for more information.
28 * For more information contact:
29 * Pulse-Eight Licensing <license@pulse-eight.com>
30 * http://www.pulse-eight.com/
31 * http://www.pulse-eight.net/
34 #ifndef CECEXPORTS_C_H_
35 #define CECEXPORTS_C_H_
42 * @brief Initialise the cec device.
43 * @param strDeviceName How to present this device to other devices.
44 * @return True when initialised, false otherwise.
46 extern DECLSPEC
bool cec_init(const char *strDeviceName
);
49 * @brief Close the cec device.
50 * @return True when the device was closed, false otherwise.
52 extern DECLSPEC
bool cec_close(void);
55 * @brief Open a connection to the CEC adapter.
56 * @param strPort The path to the port.
57 * @param iTimeout Connection timeout in ms.
58 * @return True when connected, false otherwise.
60 extern DECLSPEC
bool cec_open(const char *strPort
, int iTimeout
);
63 * @brief Ping the CEC adapter.
64 * @return True when the ping was succesful, false otherwise.
66 extern DECLSPEC
bool cec_ping(void);
69 * @brief Start the bootloader of the CEC adapter.
70 * @return True when the command was sent succesfully, false otherwise.
72 extern DECLSPEC
bool cec_start_bootloader(void);
75 * @brief Power off connected CEC capable devices.
76 * @return True when the command was sent succesfully, false otherwise.
79 extern DECLSPEC
bool cec_power_off_devices(CEC::cec_logical_address address
= CEC::CECDEVICE_BROADCAST
);
81 extern DECLSPEC
bool cec_power_off_devices(cec_logical_address address
= CECDEVICE_BROADCAST
);
85 * @brief Power on the connected CEC capable devices.
86 * @return True when the command was sent succesfully, false otherwise.
89 extern DECLSPEC
bool cec_power_on_devices(CEC::cec_logical_address address
= CEC::CECDEVICE_BROADCAST
);
91 extern DECLSPEC
bool cec_power_on_devices(cec_logical_address address
= CECDEVICE_BROADCAST
);
95 * @brief Put connected CEC capable devices in standby mode.
96 * @return True when the command was sent succesfully, false otherwise.
99 extern DECLSPEC
bool cec_standby_devices(CEC::cec_logical_address address
= CEC::CECDEVICE_BROADCAST
);
101 extern DECLSPEC
bool cec_standby_devices(cec_logical_address address
= CECDEVICE_BROADCAST
);
105 * @brief Set this device as the active source on connected CEC capable devices.
106 * @return True when the command was sent succesfully, false otherwise.
108 extern DECLSPEC
bool cec_set_active_view(void);
111 * @brief Mark this device as inactive on connected CEC capable devices.
112 * @return True when the command was sent succesfully, false otherwise.
114 extern DECLSPEC
bool cec_set_inactive_view(void);
117 * @brief Get the next log message in the queue, if there is one.
118 * @param message The next message.
119 * @return True if a message was passed, false otherwise.
122 extern DECLSPEC
bool cec_get_next_log_message(CEC::cec_log_message
*message
);
124 extern DECLSPEC
bool cec_get_next_log_message(cec_log_message
*message
);
128 * @brief Get the next keypress in the queue, if there is one.
129 * @param key The next keypress
130 * @return True if a key was passed, false otherwise.
133 extern DECLSPEC
bool cec_get_next_keypress(CEC::cec_keypress
*key
);
135 extern DECLSPEC
bool cec_get_next_keypress(cec_keypress
*key
);
139 * @brief Transmit a frame and wait for ACK.
140 * @param data The frame to send.
141 * @return True when the data was sent and acked, false otherwise.
144 extern DECLSPEC
bool cec_transmit(const CEC::cec_frame
&data
, bool bWaitForAck
= true, int64_t iTimeout
= (int64_t) 5000);
146 extern DECLSPEC
bool cec_transmit(const cec_frame
&data
, bool bWaitForAck
= true, int64_t iTimeout
= (int64_t) 5000);
150 * @brief Set the ack mask for the CEC adapter.
151 * @param ackmask The new ack mask.
152 * @return True when the ack mask was sent succesfully, false otherwise.
154 extern DECLSPEC
bool cec_set_ack_mask(uint16_t ackmask
);
156 extern DECLSPEC
int cec_get_min_version(void);
157 extern DECLSPEC
int cec_get_lib_version(void);
160 extern DECLSPEC
int cec_find_devices(std::vector
<CEC::cec_device
> &deviceList
, const char *strDevicePath
= NULL
);
162 extern DECLSPEC
int cec_find_devices(std::vector
<cec_device
> &deviceList
, const char *strDevicePath
= NULL
);
169 #endif /* CECEXPORTS_C_H_ */