fixed: don't stick a value larger than 255 in a byte
[deb_libcec.git] / include / cectypes.h
index 5d6144ae5aac2f7a0a93912b2bfcafe316e71b54..6df37d5557412b3aa827151a42a9c8e8bd6049c5 100644 (file)
@@ -80,9 +80,10 @@ namespace CEC {
 #define CEC_BUTTON_TIMEOUT           500
 
 /*!
- * don't send the same key twice within this timeout in milliseconds
+ * don't send the same key twice within this timeout in units of 50 milliseconds
+ * 4 = 200ms
  */
-#define CEC_DOUBLE_TAP_TIMEOUT_MS    250
+#define CEC_DOUBLE_TAP_TIMEOUT_MS    4
 
 /*!
  * don't query the power state for the same device within this timeout in milliseconds
@@ -322,13 +323,15 @@ namespace CEC {
 /*!
  * libCEC's minor version number
  */
-#define CEC_LIB_VERSION_MINOR        1
+#define CEC_LIB_VERSION_MINOR        2
 
 #define MSGSTART                     0xFF
 #define MSGEND                       0xFE
 #define MSGESC                       0xFD
 #define ESCOFFSET                    3
 
+#define DOUBLE_TAP_TIMEOUT_UNIT_SIZE (50)
+
 // defines to make compile time checks for certain features easy
 #define CEC_FEATURE_CONFIGURABLE_COMBO_KEY 1
 
@@ -1450,7 +1453,8 @@ typedef enum cec_client_version
   CEC_CLIENT_VERSION_2_1_2   = 0x2102,
   CEC_CLIENT_VERSION_2_1_3   = 0x2103,
   CEC_CLIENT_VERSION_2_1_4   = 0x2104,
-  CEC_CLIENT_VERSION_CURRENT = 0x2104
+  CEC_CLIENT_VERSION_2_2_0   = 0x2200,
+  CEC_CLIENT_VERSION_CURRENT = 0x2200
 } cec_client_version;
 
 typedef enum cec_server_version
@@ -1483,6 +1487,7 @@ typedef enum cec_server_version
   CEC_SERVER_VERSION_2_1_2   = 0x2102,
   CEC_SERVER_VERSION_2_1_3   = 0x2103,
   CEC_SERVER_VERSION_2_1_4   = 0x2104,
+  CEC_SERVER_VERSION_2_2_0   = 0x2200,
   CEC_SERVER_VERSION_CURRENT = 0x2104
 } cec_server_version;
 
@@ -1522,7 +1527,8 @@ struct libcec_configuration
   uint8_t               bMonitorOnly;         /*!< won't allocate a CCECClient when starting the connection when set (same as monitor mode). added in 1.6.3 */
   cec_version           cecVersion;           /*!< CEC spec version to use by libCEC. defaults to v1.4. added in 1.8.0 */
   cec_adapter_type      adapterType;          /*!< type of the CEC adapter that we're connected to. added in 1.8.2 */
-  uint8_t               iDoubleTapTimeoutMs;  /*!< prevent double taps withing this timeout. defaults to 200ms. added in 2.0.0 */
+  uint8_t               iDoubleTapTimeoutMs;  /*!< prevent double taps withing this timeout, in units of 50ms. defaults to 200ms (value: 4). added in 2.0.0,
+                                                   XXX changed meaning in 2.2.0 to not break binary compatibility. next major (3.0) release will fix it in a nicer way */
   cec_user_control_code comboKey;             /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */
   uint32_t              iComboKeyTimeoutMs;   /*!< timeout until the combo key is sent as normal keypress */
 
@@ -1534,34 +1540,34 @@ struct libcec_configuration
   {
     return (     clientVersion             == other.clientVersion &&
         !strncmp(strDeviceName,               other.strDeviceName, 13) &&
-                  deviceTypes               == other.deviceTypes &&
-                  bAutodetectAddress        == other.bAutodetectAddress &&
-                  iPhysicalAddress          == other.iPhysicalAddress &&
-                  baseDevice                == other.baseDevice &&
-                  iHDMIPort                 == other.iHDMIPort &&
-                  tvVendor                  == other.tvVendor &&
-                  wakeDevices               == other.wakeDevices &&
-                  powerOffDevices           == other.powerOffDevices &&
-                  serverVersion             == other.serverVersion &&
-                  bGetSettingsFromROM       == other.bGetSettingsFromROM &&
-                  bUseTVMenuLanguage        == other.bUseTVMenuLanguage &&
-                  bActivateSource           == other.bActivateSource &&
-                  bPowerOffScreensaver      == other.bPowerOffScreensaver &&
-                  bPowerOffOnStandby        == other.bPowerOffOnStandby &&
-                  bSendInactiveSource       == other.bSendInactiveSource &&
-                  logicalAddresses          == other.logicalAddresses &&
-                  iFirmwareVersion          == other.iFirmwareVersion &&
-                  bPowerOffDevicesOnStandby == other.bPowerOffDevicesOnStandby &&
-                  bShutdownOnStandby        == other.bShutdownOnStandby &&
+                 deviceTypes               == other.deviceTypes &&
+                 bAutodetectAddress        == other.bAutodetectAddress &&
+                 iPhysicalAddress          == other.iPhysicalAddress &&
+                 baseDevice                == other.baseDevice &&
+                 iHDMIPort                 == other.iHDMIPort &&
+                 tvVendor                  == other.tvVendor &&
+                 wakeDevices               == other.wakeDevices &&
+                 powerOffDevices           == other.powerOffDevices &&
+                 serverVersion             == other.serverVersion &&
+                 bGetSettingsFromROM       == other.bGetSettingsFromROM &&
+                 bUseTVMenuLanguage        == other.bUseTVMenuLanguage &&
+                 bActivateSource           == other.bActivateSource &&
+                 bPowerOffScreensaver      == other.bPowerOffScreensaver &&
+                 bPowerOffOnStandby        == other.bPowerOffOnStandby &&
+                 bSendInactiveSource       == other.bSendInactiveSource &&
+                 logicalAddresses          == other.logicalAddresses &&
+                 iFirmwareVersion          == other.iFirmwareVersion &&
+                 bPowerOffDevicesOnStandby == other.bPowerOffDevicesOnStandby &&
+                 bShutdownOnStandby        == other.bShutdownOnStandby &&
         !strncmp(strDeviceLanguage,           other.strDeviceLanguage, 3) &&
-                  iFirmwareBuildDate        == other.iFirmwareBuildDate &&
-                  bMonitorOnly              == other.bMonitorOnly &&
-                  cecVersion                == other.cecVersion &&
-                  adapterType               == other.adapterType &&
-                  iDoubleTapTimeoutMs       == other.iDoubleTapTimeoutMs &&
-                  (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || comboKey            == other.comboKey) &&
-                  (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || iComboKeyTimeoutMs  == other.iComboKeyTimeoutMs) &&
-                  (other.clientVersion <  CEC_CLIENT_VERSION_2_1_0 || bPowerOnScreensaver == other.bPowerOnScreensaver));
+                 iFirmwareBuildDate        == other.iFirmwareBuildDate &&
+                 bMonitorOnly              == other.bMonitorOnly &&
+                 cecVersion                == other.cecVersion &&
+                 adapterType               == other.adapterType &&
+                 iDoubleTapTimeoutMs       == other.iDoubleTapTimeoutMs &&
+                 (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || comboKey            == other.comboKey) &&
+                 (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || iComboKeyTimeoutMs  == other.iComboKeyTimeoutMs) &&
+                 (other.clientVersion <  CEC_CLIENT_VERSION_2_1_0 || bPowerOnScreensaver == other.bPowerOnScreensaver));
   }
 
   bool operator!=(const libcec_configuration &other) const