From 6b4d1b3a3a5d4c4790234e3f8fa8a8da5a3221d7 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Mon, 18 Mar 2013 16:04:02 +0100 Subject: [PATCH] added operator == for cec_datapacket --- include/cectypes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/cectypes.h b/include/cectypes.h index e8670f8..95194f6 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -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. */ -- 2.34.1