File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ bool SocketCANAnalyzer::AcquireData()
247
247
int64_t sec;
248
248
int64_t ns;
249
249
int nbytes = transport->ReadPacket (&frame, sec, ns);
250
- if (nbytes < 0 )
250
+ if (nbytes <= 0 )
251
251
break ;
252
252
253
253
// Calculate delay since start of capture, wrapping properly around second boundaries
@@ -269,6 +269,11 @@ bool SocketCANAnalyzer::AcquireData()
269
269
// bool ext = (frame.can_id & CAN_EFF_MASK) > 2047;
270
270
bool rtr = (frame.can_id & CAN_RTR_FLAG) == CAN_RTR_FLAG;
271
271
272
+ // If the packet is an error, discard and move on
273
+ bool err = (frame.can_id & CAN_ERR_FLAG);
274
+ if (err)
275
+ continue ;
276
+
272
277
cap->m_offsets .push_back (trel);
273
278
cap->m_durations .push_back (ui);
274
279
cap->m_samples .push_back (CANSymbol (CANSymbol::TYPE_SOF, 0 ));
You can’t perform that action at this time.
0 commit comments