X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2FCECExports.h;h=d1a7414242d83f8c389056fa1d66ec245c5bcf18;hb=76321de48985ea8a09dfce9650be843fafbba541;hp=0aef25c30723e72e5b32fa177a1aeaf86b02e775;hpb=825ddb962b0515e1efb06bb10a1cbb74cde803f8;p=deb_libcec.git diff --git a/include/CECExports.h b/include/CECExports.h index 0aef25c..d1a7414 100644 --- a/include/CECExports.h +++ b/include/CECExports.h @@ -34,9 +34,8 @@ #ifndef CECEXPORTS_H_ #define CECEXPORTS_H_ -#include #include -#include +#include #if !defined(DECLSPEC) #if defined(_WIN32) || defined(_WIN64) @@ -55,11 +54,10 @@ extern "C" { namespace CEC { #endif - #define CEC_MIN_VERSION 2 - #define CEC_LIB_VERSION 2 + #define CEC_MIN_VERSION 5 + #define CEC_LIB_VERSION 5 #define CEC_SETTLE_DOWN_TIME 1000 - - typedef std::vector cec_frame; + #define CEC_BUTTON_TIMEOUT 500 typedef enum cec_user_control_code { @@ -243,7 +241,7 @@ namespace CEC { typedef struct cec_log_message { - std::string message; + char message[1024]; cec_log_level level; } cec_log_message; @@ -253,11 +251,36 @@ namespace CEC { unsigned int duration; } cec_keypress; - typedef struct cec_device + typedef struct cec_adapter + { + char path[1024]; + char comm[1024]; + } cec_adapter; + + typedef struct cec_frame { - std::string path; - std::string comm; - } cec_device; + uint8_t data[20]; + uint8_t size; + + void shift(uint8_t num) + { + for (uint8_t iPtr = 0; iPtr < num; iPtr++) + data[iPtr] = iPtr + num < size ? data[iPtr + num] : 0; + size -= num; + } + + void push_back(uint8_t add) + { + if (size < 20) + data[size++] = add; + } + + void clear(void) + { + memset(data, 0, sizeof(data)); + size = 0; + } + } cec_frame; typedef struct cec_command { @@ -265,6 +288,14 @@ namespace CEC { cec_logical_address destination; cec_opcode opcode; cec_frame parameters; + + void clear(void) + { + source = CECDEVICE_UNKNOWN; + destination = CECDEVICE_UNKNOWN; + opcode = CEC_OPCODE_FEATURE_ABORT; + parameters.clear(); + }; } cec_command; //default physical address 1.0.0.0