added operator == for cec_datapacket
[deb_libcec.git] / include / cectypes.h
index 58c7f6c15f32c4ca224af8f455bc5304da4280a9..95194f61ecfb8f6ed0eb53924faa212513477b6b 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -915,6 +915,16 @@ typedef struct cec_datapacket
     return *this;
   }
 
+  bool operator ==(const struct cec_datapacket& packet) const
+  {
+    if (size != packet.size)
+      return false;
+    for (uint8_t iPtr = 0; iPtr < size; iPtr++)
+      if (packet.data[iPtr] != data[iPtr])
+        return false;
+    return true;
+  }
+
   bool    IsEmpty(void) const             { return size == 0; }   /**< @return True when this packet is empty, false otherwise. */
   bool    IsFull(void) const              { return size == 100; } /**< @return True when this packet is false, false otherwise. */
 
@@ -1281,7 +1291,8 @@ typedef enum libcec_alert
   CEC_ALERT_CONNECTION_LOST,
   CEC_ALERT_PERMISSION_ERROR,
   CEC_ALERT_PORT_BUSY,
-  CEC_ALERT_PHYSICAL_ADDRESS_ERROR
+  CEC_ALERT_PHYSICAL_ADDRESS_ERROR,
+  CEC_ALERT_TV_POLL_FAILED
 } libcec_alert;
 
 typedef enum libcec_parameter_type
@@ -1405,7 +1416,8 @@ typedef enum cec_client_version
   CEC_CLIENT_VERSION_2_0_4   = 0x2004,
   CEC_CLIENT_VERSION_2_0_5   = 0x2005,
   CEC_CLIENT_VERSION_2_1_0   = 0x2100,
-  CEC_CLIENT_VERSION_CURRENT = 0x2100
+  CEC_CLIENT_VERSION_2_1_1   = 0x2101,
+  CEC_CLIENT_VERSION_CURRENT = 0x2101
 } cec_client_version;
 
 typedef enum cec_server_version
@@ -1434,7 +1446,8 @@ typedef enum cec_server_version
   CEC_SERVER_VERSION_2_0_4   = 0x2004,
   CEC_SERVER_VERSION_2_0_5   = 0x2005,
   CEC_SERVER_VERSION_2_1_0   = 0x2100,
-  CEC_SERVER_VERSION_CURRENT = 0x2100
+  CEC_SERVER_VERSION_2_1_1   = 0x2101,
+  CEC_SERVER_VERSION_CURRENT = 0x2101
 } cec_server_version;
 
 struct libcec_configuration