X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2FCECExports.h;h=d1a7414242d83f8c389056fa1d66ec245c5bcf18;hb=76321de48985ea8a09dfce9650be843fafbba541;hp=bedd0e0dabcb086f744e6995f5f4e9c509b55810;hpb=2abe74ebbd27d8c30060b3eebb363e10d3fbfd80;p=deb_libcec.git diff --git a/include/CECExports.h b/include/CECExports.h index bedd0e0..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,13 +54,11 @@ extern "C" { namespace CEC { #endif - #define CEC_MIN_VERSION 3 - #define CEC_LIB_VERSION 3 + #define CEC_MIN_VERSION 5 + #define CEC_LIB_VERSION 5 #define CEC_SETTLE_DOWN_TIME 1000 #define CEC_BUTTON_TIMEOUT 500 - typedef std::vector cec_frame; - typedef enum cec_user_control_code { CEC_USER_CONTROL_CODE_SELECT = 0x00, @@ -244,7 +241,7 @@ namespace CEC { typedef struct cec_log_message { - std::string message; + char message[1024]; cec_log_level level; } cec_log_message; @@ -256,16 +253,49 @@ namespace CEC { typedef struct cec_adapter { - std::string path; - std::string comm; + char path[1024]; + char comm[1024]; } cec_adapter; + typedef struct cec_frame + { + 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 { cec_logical_address source; 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