libCEC 8.1.0
C / C++ API — control CEC-capable HDMI devices
Loading...
Searching...
No Matches
cecc.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This file is part of the libCEC(R) library.
4 *
5 * libCEC(R) is Copyright (C) 2011-2015 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
40extern "C" {
41#endif
42
43#ifdef __cplusplus
44#define CEC_NAMESPACE CEC::
46#else
47#define CEC_NAMESPACE
48typedef void* libcec_connection_t;
49#endif
50
51extern DECLSPEC libcec_connection_t libcec_initialise(CEC_NAMESPACE libcec_configuration* configuration);
52extern DECLSPEC void libcec_destroy(libcec_connection_t connection);
53extern DECLSPEC int libcec_open(libcec_connection_t connection, const char* strPort, uint32_t iTimeout);
54extern DECLSPEC void libcec_close(libcec_connection_t connection);
55extern DECLSPEC void libcec_clear_configuration(CEC_NAMESPACE libcec_configuration* configuration);
56#if CEC_LIB_VERSION_MAJOR >= 5
57extern DECLSPEC int libcec_set_callbacks(libcec_connection_t connection, CEC_NAMESPACE ICECCallbacks* callbacks, void* cbParam);
58extern DECLSPEC int libcec_disable_callbacks(libcec_connection_t connection);
59#else
60extern DECLSPEC int libcec_enable_callbacks(libcec_connection_t connection, void* cbParam, CEC_NAMESPACE ICECCallbacks* callbacks);
61#endif
62extern DECLSPEC int8_t libcec_find_adapters(libcec_connection_t connection, CEC_NAMESPACE cec_adapter* deviceList, uint8_t iBufSize, const char* strDevicePath);
63extern DECLSPEC int libcec_ping_adapters(libcec_connection_t connection);
64extern DECLSPEC int libcec_start_bootloader(libcec_connection_t connection);
65extern DECLSPEC int libcec_power_on_devices(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address address);
66extern DECLSPEC int libcec_standby_devices(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address address);
67extern DECLSPEC int libcec_set_active_source(libcec_connection_t connection, CEC_NAMESPACE cec_device_type type);
68extern DECLSPEC int libcec_set_deck_control_mode(libcec_connection_t connection, CEC_NAMESPACE cec_deck_control_mode mode, int bSendUpdate);
69extern DECLSPEC int libcec_set_deck_info(libcec_connection_t connection, CEC_NAMESPACE cec_deck_info info, int bSendUpdate);
70extern DECLSPEC int libcec_set_inactive_view(libcec_connection_t connection);
71extern DECLSPEC int libcec_set_menu_state(libcec_connection_t connection, CEC_NAMESPACE cec_menu_state state, int bSendUpdate);
72extern DECLSPEC int libcec_transmit(libcec_connection_t connection, const CEC_NAMESPACE cec_command* data);
73extern DECLSPEC int libcec_set_logical_address(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
74extern DECLSPEC int libcec_set_physical_address(libcec_connection_t connection, uint16_t iPhysicalAddress);
75extern DECLSPEC int libcec_set_osd_string(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress, CEC_NAMESPACE cec_display_control duration, const char* strMessage);
76extern DECLSPEC int libcec_switch_monitoring(libcec_connection_t connection, int bEnable);
77extern DECLSPEC CEC_NAMESPACE cec_version libcec_get_device_cec_version(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
78extern DECLSPEC int libcec_get_device_menu_language(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress, CEC_NAMESPACE cec_menu_language language);
79extern DECLSPEC uint32_t libcec_get_device_vendor_id(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
80extern DECLSPEC uint16_t libcec_get_device_physical_address(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
81extern DECLSPEC CEC_NAMESPACE cec_logical_address libcec_get_active_source(libcec_connection_t connection);
82extern DECLSPEC int libcec_is_active_source(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress);
83extern DECLSPEC CEC_NAMESPACE cec_power_status libcec_get_device_power_status(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
84extern DECLSPEC int libcec_poll_device(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iLogicalAddress);
86extern DECLSPEC int libcec_is_active_device(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address address);
87extern DECLSPEC int libcec_is_active_device_type(libcec_connection_t connection, CEC_NAMESPACE cec_device_type type);
88extern DECLSPEC int libcec_set_hdmi_port(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address baseDevice, uint8_t iPort);
89extern DECLSPEC int libcec_volume_up(libcec_connection_t connection, int bSendRelease);
90extern DECLSPEC int libcec_volume_down(libcec_connection_t connection, int bSendRelease);
91#if CEC_LIB_VERSION_MAJOR >= 5
92extern DECLSPEC int libcec_mute_audio(libcec_connection_t connection, int bSendRelease);
93#endif
94extern DECLSPEC int libcec_send_keypress(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iDestination, CEC_NAMESPACE cec_user_control_code key, int bWait);
95extern DECLSPEC int libcec_send_key_release(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iDestination, int bWait);
96extern DECLSPEC int libcec_get_device_osd_name(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress, CEC_NAMESPACE cec_osd_name name);
97extern DECLSPEC int libcec_set_stream_path_logical(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress);
98extern DECLSPEC int libcec_set_stream_path_physical(libcec_connection_t connection, uint16_t iPhysicalAddress);
100extern DECLSPEC int libcec_get_current_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
101#if CEC_LIB_VERSION_MAJOR >= 5
103#else
104extern DECLSPEC int libcec_can_persist_configuration(libcec_connection_t connection);
105extern DECLSPEC int libcec_persist_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
106#endif
107extern DECLSPEC int libcec_set_configuration(libcec_connection_t connection, const CEC_NAMESPACE libcec_configuration* configuration);
108extern DECLSPEC void libcec_rescan_devices(libcec_connection_t connection);
110extern DECLSPEC int libcec_get_device_information(libcec_connection_t connection, const char* strPort, CEC_NAMESPACE libcec_configuration* config, uint32_t iTimeoutMs);
111extern DECLSPEC const char* libcec_get_lib_info(libcec_connection_t connection);
112extern DECLSPEC void libcec_init_video_standalone(libcec_connection_t connection);
113extern DECLSPEC uint16_t libcec_get_adapter_vendor_id(libcec_connection_t connection);
114extern DECLSPEC uint16_t libcec_get_adapter_product_id(libcec_connection_t connection);
115extern DECLSPEC uint8_t libcec_audio_toggle_mute(libcec_connection_t connection);
116extern DECLSPEC uint8_t libcec_audio_mute(libcec_connection_t connection);
117extern DECLSPEC uint8_t libcec_audio_unmute(libcec_connection_t connection);
118extern DECLSPEC uint8_t libcec_audio_get_status(libcec_connection_t connection);
119extern DECLSPEC int libcec_system_audio_mode(libcec_connection_t connection, int bEnable);
121extern DECLSPEC int8_t libcec_detect_adapters(libcec_connection_t connection, CEC_NAMESPACE cec_adapter_descriptor* deviceList, uint8_t iBufSize, const char* strDevicePath, int bQuickScan);
122#if CEC_LIB_VERSION_MAJOR >= 5
123extern DECLSPEC int libcec_get_stats(libcec_connection_t connection, struct CEC_NAMESPACE cec_adapter_stats* stats);
124#endif
125#ifdef SWIG
126%cstring_bounded_output(char* buf, 50);
127#endif
128extern DECLSPEC void libcec_menu_state_to_string(const CEC_NAMESPACE cec_menu_state state, char* buf, size_t bufsize);
129extern DECLSPEC void libcec_cec_version_to_string(const CEC_NAMESPACE cec_version version, char* buf, size_t bufsize);
130extern DECLSPEC void libcec_power_status_to_string(const CEC_NAMESPACE cec_power_status status, char* buf, size_t bufsize);
131extern DECLSPEC void libcec_logical_address_to_string(const CEC_NAMESPACE cec_logical_address address, char* buf, size_t bufsize);
132extern DECLSPEC void libcec_deck_control_mode_to_string(const CEC_NAMESPACE cec_deck_control_mode mode, char* buf, size_t bufsize);
133extern DECLSPEC void libcec_deck_status_to_string(const CEC_NAMESPACE cec_deck_info status, char* buf, size_t bufsize);
134extern DECLSPEC void libcec_opcode_to_string(const CEC_NAMESPACE cec_opcode opcode, char* buf, size_t bufsize);
135extern DECLSPEC void libcec_system_audio_status_to_string(const CEC_NAMESPACE cec_system_audio_status mode, char* buf, size_t bufsize);
136extern DECLSPEC void libcec_audio_status_to_string(const CEC_NAMESPACE cec_audio_status status, char* buf, size_t bufsize);
137extern DECLSPEC void libcec_vendor_id_to_string(const CEC_NAMESPACE cec_vendor_id vendor, char* buf, size_t bufsize);
138extern DECLSPEC void libcec_user_control_key_to_string(const CEC_NAMESPACE cec_user_control_code key, char* buf, size_t bufsize);
139extern DECLSPEC void libcec_adapter_type_to_string(const CEC_NAMESPACE cec_adapter_type type, char* buf, size_t bufsize);
140extern DECLSPEC void libcec_version_to_string(uint32_t version, char* buf, size_t bufsize);
141
142#ifdef __cplusplus
143};
144#endif
145
146#endif /* CECEXPORTS_C_H_ */
int libcec_disable_callbacks(libcec_connection_t connection)
CEC::ICECAdapter * libcec_connection_t
Definition cecc.h:45
int libcec_volume_down(libcec_connection_t connection, int bSendRelease)
void libcec_rescan_devices(libcec_connection_t connection)
void libcec_destroy(libcec_connection_t connection)
void libcec_opcode_to_string(const CEC::cec_opcode opcode, char *buf, size_t bufsize)
int libcec_is_active_device(libcec_connection_t connection, CEC::cec_logical_address address)
void libcec_deck_control_mode_to_string(const CEC::cec_deck_control_mode mode, char *buf, size_t bufsize)
void libcec_close(libcec_connection_t connection)
void libcec_system_audio_status_to_string(const CEC::cec_system_audio_status mode, char *buf, size_t bufsize)
void libcec_cec_version_to_string(const CEC::cec_version version, char *buf, size_t bufsize)
int8_t libcec_find_adapters(libcec_connection_t connection, CEC::cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath)
int libcec_set_deck_info(libcec_connection_t connection, CEC::cec_deck_info info, int bSendUpdate)
void libcec_adapter_type_to_string(const CEC::cec_adapter_type type, char *buf, size_t bufsize)
void libcec_menu_state_to_string(const CEC::cec_menu_state state, char *buf, size_t bufsize)
int libcec_set_menu_state(libcec_connection_t connection, CEC::cec_menu_state state, int bSendUpdate)
int libcec_system_audio_mode(libcec_connection_t connection, int bEnable)
int libcec_poll_device(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
int libcec_get_device_osd_name(libcec_connection_t connection, CEC::cec_logical_address iAddress, CEC::cec_osd_name name)
void libcec_init_video_standalone(libcec_connection_t connection)
uint16_t libcec_get_adapter_vendor_id(libcec_connection_t connection)
int libcec_is_libcec_active_source(libcec_connection_t connection)
int libcec_set_logical_address(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
int8_t libcec_detect_adapters(libcec_connection_t connection, CEC::cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan)
int libcec_volume_up(libcec_connection_t connection, int bSendRelease)
int libcec_set_callbacks(libcec_connection_t connection, CEC::ICECCallbacks *callbacks, void *cbParam)
uint8_t libcec_audio_toggle_mute(libcec_connection_t connection)
int libcec_send_key_release(libcec_connection_t connection, CEC::cec_logical_address iDestination, int bWait)
int libcec_set_stream_path_physical(libcec_connection_t connection, uint16_t iPhysicalAddress)
int libcec_set_configuration(libcec_connection_t connection, const CEC::libcec_configuration *configuration)
int libcec_set_deck_control_mode(libcec_connection_t connection, CEC::cec_deck_control_mode mode, int bSendUpdate)
void libcec_user_control_key_to_string(const CEC::cec_user_control_code key, char *buf, size_t bufsize)
int libcec_is_active_device_type(libcec_connection_t connection, CEC::cec_device_type type)
int libcec_switch_monitoring(libcec_connection_t connection, int bEnable)
void libcec_clear_configuration(CEC::libcec_configuration *configuration)
int libcec_standby_devices(libcec_connection_t connection, CEC::cec_logical_address address)
uint8_t libcec_audio_mute(libcec_connection_t connection)
int libcec_set_inactive_view(libcec_connection_t connection)
void libcec_version_to_string(uint32_t version, char *buf, size_t bufsize)
int libcec_get_device_menu_language(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress, CEC::cec_menu_language language)
int libcec_get_current_configuration(libcec_connection_t connection, CEC::libcec_configuration *configuration)
CEC::cec_logical_addresses libcec_get_logical_addresses(libcec_connection_t connection)
void libcec_logical_address_to_string(const CEC::cec_logical_address address, char *buf, size_t bufsize)
int libcec_transmit(libcec_connection_t connection, const CEC::cec_command *data)
int libcec_set_active_source(libcec_connection_t connection, CEC::cec_device_type type)
CEC::cec_logical_address libcec_get_active_source(libcec_connection_t connection)
const char * libcec_get_lib_info(libcec_connection_t connection)
libcec_connection_t libcec_initialise(CEC::libcec_configuration *configuration)
int libcec_power_on_devices(libcec_connection_t connection, CEC::cec_logical_address address)
int libcec_send_keypress(libcec_connection_t connection, CEC::cec_logical_address iDestination, CEC::cec_user_control_code key, int bWait)
void libcec_power_status_to_string(const CEC::cec_power_status status, char *buf, size_t bufsize)
int libcec_get_device_information(libcec_connection_t connection, const char *strPort, CEC::libcec_configuration *config, uint32_t iTimeoutMs)
int libcec_is_active_source(libcec_connection_t connection, CEC::cec_logical_address iAddress)
uint8_t libcec_audio_get_status(libcec_connection_t connection)
uint16_t libcec_get_device_physical_address(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
uint16_t libcec_get_adapter_product_id(libcec_connection_t connection)
uint8_t libcec_audio_unmute(libcec_connection_t connection)
uint32_t libcec_get_device_vendor_id(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
void libcec_deck_status_to_string(const CEC::cec_deck_info status, char *buf, size_t bufsize)
#define CEC_NAMESPACE
Definition cecc.h:44
int libcec_set_stream_path_logical(libcec_connection_t connection, CEC::cec_logical_address iAddress)
void libcec_audio_status_to_string(const CEC::cec_audio_status status, char *buf, size_t bufsize)
int libcec_open(libcec_connection_t connection, const char *strPort, uint32_t iTimeout)
CEC::cec_power_status libcec_get_device_power_status(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
CEC::cec_logical_addresses libcec_get_active_devices(libcec_connection_t connection)
int libcec_start_bootloader(libcec_connection_t connection)
int libcec_can_save_configuration(libcec_connection_t connection)
int libcec_get_stats(libcec_connection_t connection, struct CEC::cec_adapter_stats *stats)
int libcec_set_osd_string(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress, CEC::cec_display_control duration, const char *strMessage)
int libcec_mute_audio(libcec_connection_t connection, int bSendRelease)
void libcec_vendor_id_to_string(const CEC::cec_vendor_id vendor, char *buf, size_t bufsize)
int libcec_set_hdmi_port(libcec_connection_t connection, CEC::cec_logical_address baseDevice, uint8_t iPort)
uint8_t libcec_system_audio_mode_get_status(libcec_connection_t connection)
CEC::cec_version libcec_get_device_cec_version(libcec_connection_t connection, CEC::cec_logical_address iLogicalAddress)
int libcec_set_physical_address(libcec_connection_t connection, uint16_t iPhysicalAddress)
int libcec_ping_adapters(libcec_connection_t connection)
To create a new libCEC instance, call CECInitialise() and pass the configuration as argument.
Definition cec.h:54