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.
2 parents ef0b31a + b9f2367 commit 891805bCopy full SHA for 891805b
drivers/include/drivers/interfaces/InterfaceCAN.h
@@ -109,6 +109,35 @@ 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 operator ==(const CANMessage &b) const
117
+ {
118
+ if (id != b.id) {
119
+ return false;
120
+ }
121
+ if (len != b.len) {
122
123
124
+ if (format != b.format) {
125
126
127
+ if (type != b.type) {
128
129
130
+ if (memcmp(data, b.data, len) != 0) {
131
132
133
134
+ return true;
135
136
137
+ bool operator !=(const CANMessage &b) const
138
139
+ return !(*this == b);
140
141
};
142
143
/** @}*/
0 commit comments