cec: fixec - don't deadlock when a command wasn't sent
[deb_libcec.git] / include / cectypes.h
index c08c64d4d4bdcb2d462a1083f4fc13b86e866856..53418abded9421f71b411d641ca31e33d28febf8 100644 (file)
@@ -97,13 +97,14 @@ typedef enum
   CEC_TRUE = 1
 } ECecBoolean;
 
-typedef enum
+typedef enum cec_version
 {
-  CEC_VERSION_1_2 = 0x01,
-  CEC_VERSION_1_2A = 0x02,
-  CEC_VERSION_1_3 = 0x03,
-  CEC_VERSION_1_3A = 0x04
-} ECecVersion;
+  CEC_VERSION_UNKNOWN = 0x00,
+  CEC_VERSION_1_2     = 0x01,
+  CEC_VERSION_1_2A    = 0x02,
+  CEC_VERSION_1_3     = 0x03,
+  CEC_VERSION_1_3A    = 0x04
+} cec_version;
 
 typedef enum
 {
@@ -197,13 +198,14 @@ typedef enum
   CEC_PLAY_MODE_SLOW_REVERSE_MAX_SPEED = 0x1B
 } ECecPlayMode;
 
-typedef enum
+typedef enum cec_power_status
 {
   CEC_POWER_STATUS_ON = 0x00,
   CEC_POWER_STATUS_STANDBY = 0x01,
   CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON = 0x02,
-  CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY = 0x03
-} ECecPowerStatus;
+  CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY = 0x03,
+  CEC_POWER_STATUS_UNKNOWN = 0x99
+} cec_power_status;
 
 typedef enum
 {
@@ -537,6 +539,12 @@ typedef enum cec_log_level
   CEC_LOG_ALL     = 31
 } cec_log_level;
 
+typedef struct cec_menu_language
+{
+  char                language[4];
+  cec_logical_address device;
+} cec_menu_language;
+
 typedef struct cec_log_message
 {
   char          message[1024];
@@ -634,6 +642,7 @@ typedef struct cec_command
   cec_opcode          opcode;
   cec_datapacket      parameters;
   int8_t              opcode_set;
+  int32_t             ack_timeout;
 
 #ifdef __cplusplus
   static void format(cec_command &command, cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode)
@@ -643,6 +652,7 @@ typedef struct cec_command
     command.destination = destination;
     command.opcode      = opcode;
     command.opcode_set  = 1;
+    command.ack_timeout = 1000;
   }
 
   void push_back(uint8_t data)
@@ -669,6 +679,7 @@ typedef struct cec_command
     eom         = 0;
     opcode_set  = 0;
     opcode      = CEC_OPCODE_FEATURE_ABORT;
+    ack_timeout = 1000;
     parameters.clear();
   };
 #endif