We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7279ae2 commit d16df8cCopy full SHA for d16df8c
drivers/include/drivers/interfaces/InterfaceCAN.h
@@ -109,6 +109,28 @@ class CANMessage : public CAN_Message {
109
id = _id;
110
memset(data, 0, 8);
111
}
112
+
113
+ /**
114
+ * "Deep" comparison operator (ie: compare value of each data member)
115
+ */
116
+ bool CANMessage::operator ==(const CANMessage &b) const {
117
+ if(id != b.id)
118
+ return false;
119
+ if(len != b.len)
120
121
+ if(format != b.format)
122
123
+ if(type != b.type)
124
125
+ if(memcmp(data, b.data, len) != 0)
126
127
128
+ return true;
129
+ }
130
131
+ bool CANMessage::operator !=(const CANMessage &b) const {
132
+ return !(*this == b);
133
134
};
135
136
/** @}*/
0 commit comments