cec: added RescanDevices()/cec_rescan_devices() to the interface, to let libCEC force...
[deb_libcec.git] / include / cecc.h
1 #pragma once
2 /*
3 * This file is part of the libCEC(R) library.
4 *
5 * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
6 * libCEC(R) is an original work, containing original code.
7 *
8 * libCEC(R) is a trademark of Pulse-Eight Limited.
9 *
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.
14 *
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.
19 *
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.
23 *
24 *
25 * Alternatively, you can license this library under a commercial license,
26 * please contact Pulse-Eight Licensing for more information.
27 *
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/
32 */
33
34 #ifndef CECEXPORTS_C_H_
35 #define CECEXPORTS_C_H_
36
37 #include "cectypes.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifdef __cplusplus
44 extern DECLSPEC int cec_initialise(CEC::libcec_configuration *configuration);
45 #else
46 extern DECLSPEC int cec_initialise(libcec_configuration *configuration);
47 #endif
48
49 #ifdef __cplusplus
50 extern DECLSPEC int cec_init_typed(const char *strDeviceName, CEC::cec_device_type_list deviceTypes);
51 #else
52 extern DECLSPEC int cec_init_typed(const char *strDeviceName, cec_device_type_list deviceTypes);
53 #endif
54
55 extern DECLSPEC void cec_destroy(void);
56
57 extern DECLSPEC int cec_open(const char *strPort, uint32_t iTimeout);
58
59 extern DECLSPEC void cec_close(void);
60
61 #ifdef __cplusplus
62 extern DECLSPEC int cec_enable_callbacks(void *cbParam, CEC::ICECCallbacks *callbacks);
63 #else
64 extern DECLSPEC int cec_enable_callbacks(void *cbParam, ICECCallbacks *callbacks);
65 #endif
66
67 #ifdef __cplusplus
68 extern DECLSPEC int8_t cec_find_adapters(CEC::cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath);
69 #else
70 extern DECLSPEC int8_t cec_find_adapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath);
71 #endif
72
73 extern DECLSPEC int cec_ping_adapters(void);
74
75 extern DECLSPEC int cec_start_bootloader(void);
76
77 #ifdef __cplusplus
78 extern DECLSPEC int cec_power_on_devices(CEC::cec_logical_address address);
79 #else
80 extern DECLSPEC int cec_power_on_devices(cec_logical_address address);
81 #endif
82
83 #ifdef __cplusplus
84 extern DECLSPEC int cec_standby_devices(CEC::cec_logical_address address);
85 #else
86 extern DECLSPEC int cec_standby_devices(cec_logical_address address);
87 #endif
88
89 #ifdef __cplusplus
90 extern DECLSPEC int cec_set_active_source(CEC::cec_device_type type);
91 #else
92 extern DECLSPEC int cec_set_active_source(cec_device_type type);
93 #endif
94
95 #ifdef __cplusplus
96 extern DECLSPEC int cec_set_deck_control_mode(CEC::cec_deck_control_mode mode, int bSendUpdate);
97 #else
98 extern DECLSPEC int cec_set_deck_control_mode(cec_deck_control_mode mode, int bSendUpdate);
99 #endif
100
101 #ifdef __cplusplus
102 extern DECLSPEC int cec_set_deck_info(CEC::cec_deck_info info, int bSendUpdate);
103 #else
104 extern DECLSPEC int cec_set_deck_info(cec_deck_info info, int bSendUpdate);
105 #endif
106
107 extern DECLSPEC int cec_set_inactive_view(void);
108
109 #ifdef __cplusplus
110 extern DECLSPEC int cec_set_menu_state(CEC::cec_menu_state state, int bSendUpdate);
111 #else
112 extern DECLSPEC int cec_set_menu_state(cec_menu_state state, int bSendUpdate);
113 #endif
114
115 #ifdef __cplusplus
116 extern DECLSPEC int cec_transmit(const CEC::cec_command *data);
117 #else
118 extern DECLSPEC int cec_transmit(const cec_command *data);
119 #endif
120
121 #ifdef __cplusplus
122 extern DECLSPEC int cec_set_logical_address(CEC::cec_logical_address iLogicalAddress);
123 #else
124 extern DECLSPEC int cec_set_logical_address(cec_logical_address iLogicalAddress);
125 #endif
126
127 extern DECLSPEC int cec_set_physical_address(uint16_t iPhysicalAddress);
128
129 #ifdef __cplusplus
130 extern DECLSPEC int cec_set_osd_string(CEC::cec_logical_address iLogicalAddress, CEC::cec_display_control duration, const char *strMessage);
131 #else
132 extern DECLSPEC int cec_set_osd_string(cec_logical_address iLogicalAddress, cec_display_control duration, const char *strMessage);
133 #endif
134
135 extern DECLSPEC int cec_switch_monitoring(int bEnable);
136
137 #ifdef __cplusplus
138 extern DECLSPEC CEC::cec_version cec_get_device_cec_version(CEC::cec_logical_address iLogicalAddress);
139 #else
140 extern DECLSPEC cec_version cec_get_device_cec_version(cec_logical_address iLogicalAddress);
141 #endif
142
143 #ifdef __cplusplus
144 extern DECLSPEC int cec_get_device_menu_language(CEC::cec_logical_address iLogicalAddress, CEC::cec_menu_language *language);
145 #else
146 extern DECLSPEC int cec_get_device_menu_language(cec_logical_address iLogicalAddress, cec_menu_language *language);
147 #endif
148
149 #ifdef __cplusplus
150 extern DECLSPEC uint64_t cec_get_device_vendor_id(CEC::cec_logical_address iLogicalAddress);
151 #else
152 extern DECLSPEC uint64_t cec_get_device_vendor_id(cec_logical_address iLogicalAddress);
153 #endif
154
155 #ifdef __cplusplus
156 extern DECLSPEC uint16_t cec_get_device_physical_address(CEC::cec_logical_address iLogicalAddress);
157 #else
158 extern DECLSPEC uint16_t cec_get_device_physical_address(cec_logical_address iLogicalAddress);
159 #endif
160
161 #ifdef __cplusplus
162 extern DECLSPEC CEC::cec_logical_address cec_get_active_source(void);
163 #else
164 extern DECLSPEC cec_logical_address cec_get_active_source(void);
165 #endif
166
167 #ifdef __cplusplus
168 extern DECLSPEC int cec_is_active_source(CEC::cec_logical_address iAddress);
169 #else
170 extern DECLSPEC int cec_is_active_source(cec_logical_address iAddress);
171 #endif
172
173 #ifdef __cplusplus
174 extern DECLSPEC CEC::cec_power_status cec_get_device_power_status(CEC::cec_logical_address iLogicalAddress);
175 #else
176 extern DECLSPEC cec_power_status cec_get_device_power_status(cec_logical_address iLogicalAddress);
177 #endif
178
179 #ifdef __cplusplus
180 extern DECLSPEC int cec_poll_device(CEC::cec_logical_address iLogicalAddress);
181 #else
182 extern DECLSPEC int cec_poll_device(cec_logical_address iLogicalAddress);
183 #endif
184
185 #ifdef __cplusplus
186 extern DECLSPEC CEC::cec_logical_addresses cec_get_active_devices(void);
187 #else
188 extern DECLSPEC cec_logical_addresses cec_get_active_devices(void);
189 #endif
190
191 #ifdef __cplusplus
192 extern DECLSPEC int cec_is_active_device(CEC::cec_logical_address iAddress);
193 #else
194 extern DECLSPEC int cec_is_active_device(cec_logical_address iAddress);
195 #endif
196
197 #ifdef __cplusplus
198 extern DECLSPEC int cec_is_active_device_type(CEC::cec_device_type type);
199 #else
200 extern DECLSPEC int cec_is_active_device_type(cec_device_type type);
201 #endif
202
203 #ifdef __cplusplus
204 extern DECLSPEC int cec_set_hdmi_port(CEC::cec_logical_address iBaseDevice, uint8_t iPort);
205 #else
206 extern DECLSPEC int cec_set_hdmi_port(cec_logical_address iBaseDevice, uint8_t iPort);
207 #endif
208
209 extern DECLSPEC int cec_volume_up(int bSendRelease);
210
211 extern DECLSPEC int cec_volume_down(int bSendRelease);
212
213 extern DECLSPEC int cec_mute_audio(int bSendRelease);
214
215 #ifdef __cplusplus
216 extern DECLSPEC int cec_send_keypress(CEC::cec_logical_address iDestination, CEC::cec_user_control_code key, int bWait);
217 #else
218 extern DECLSPEC int cec_send_keypress(cec_logical_address iDestination, cec_user_control_code key, int bWait);
219 #endif
220
221 #ifdef __cplusplus
222 extern DECLSPEC int cec_send_key_release(CEC::cec_logical_address iDestination, int bWait);
223 #else
224 extern DECLSPEC int cec_send_key_release(cec_logical_address iDestination, int bWait);
225 #endif
226
227 #ifdef __cplusplus
228 extern DECLSPEC CEC::cec_osd_name cec_get_device_osd_name(CEC::cec_logical_address iAddress);
229 #else
230 extern DECLSPEC cec_osd_name cec_get_device_osd_name(cec_logical_address iAddress);
231 #endif
232
233 #ifdef __cplusplus
234 extern DECLSPEC int cec_set_stream_path_logical(CEC::cec_logical_address iAddress);
235 #else
236 extern DECLSPEC int cec_set_stream_path_logical(cec_logical_address iAddress);
237 #endif
238
239 extern DECLSPEC int cec_set_stream_path_physical(uint16_t iPhysicalAddress);
240
241 #ifdef __cplusplus
242 extern DECLSPEC CEC::cec_logical_addresses cec_get_logical_addresses(void);
243 #else
244 extern DECLSPEC cec_logical_addresses cec_get_logical_addresses(void);
245 #endif
246
247 #ifdef __cplusplus
248 extern DECLSPEC int cec_get_current_configuration(CEC::libcec_configuration *configuration);
249 #else
250 extern DECLSPEC int cec_get_current_configuration(libcec_configuration *configuration);
251 #endif
252
253 extern DECLSPEC int cec_can_persist_configuration(void);
254
255 #ifdef __cplusplus
256 extern DECLSPEC int cec_persist_configuration(CEC::libcec_configuration *configuration);
257 #else
258 extern DECLSPEC int cec_persist_configuration(libcec_configuration *configuration);
259 #endif
260
261 #ifdef __cplusplus
262 extern DECLSPEC int cec_set_configuration(const CEC::libcec_configuration *configuration);
263 #else
264 extern DECLSPEC int cec_set_configuration(const libcec_configuration *configuration);
265 #endif
266
267 extern DECLSPEC void cec_rescan_devices(void);
268
269 ////// deprecated methods, may be removed in a future version //////
270
271 extern DECLSPEC int cec_enable_physical_address_detection(void);
272
273 extern DECLSPEC int cec_set_active_view(void);
274
275 extern DECLSPEC int8_t cec_get_min_lib_version(void);
276
277 extern DECLSPEC int8_t cec_get_lib_version_major(void);
278
279 extern DECLSPEC int8_t cec_get_lib_version_minor(void);
280
281 #ifdef __cplusplus
282 extern DECLSPEC int cec_get_next_log_message(CEC::cec_log_message *message);
283 #else
284 extern DECLSPEC int cec_get_next_log_message(cec_log_message *message);
285 #endif
286
287 #ifdef __cplusplus
288 extern DECLSPEC int cec_get_next_keypress(CEC::cec_keypress *key);
289 #else
290 extern DECLSPEC int cec_get_next_keypress(cec_keypress *key);
291 #endif
292
293 #ifdef __cplusplus
294 extern DECLSPEC int cec_get_next_command(CEC::cec_command *command);
295 #else
296 extern DECLSPEC int cec_get_next_command(cec_command *command);
297 #endif
298
299 #ifdef __cplusplus
300 };
301 #endif
302
303 #endif /* CECEXPORTS_C_H_ */