From d0f191c3eed394d343dcbb6aed0ea37407e0dbb0 Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 2 Oct 2024 20:04:14 -0400 Subject: [PATCH] Set CAN Socket to accept errors --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ddbe1c9..651bc9c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use calypso::{ }; use clap::Parser; use protobuf::Message; -use socketcan::{CanError, CanFrame, CanSocket, EmbeddedFrame, Frame, Id, Socket}; +use socketcan::{CanError, CanFrame, CanSocket, EmbeddedFrame, Frame, Id, Socket, }; const ENCODER_MAP_SUB: &str = "Calypso/Bidir/Command/#"; @@ -57,6 +57,7 @@ fn read_can(pub_path: &str, can_interface: &str) -> JoinHandle { } let socket = CanSocket::open(can_interface).expect("Failed to open CAN socket!"); + socket.set_error_filter_accept_all().expect("Failed to set error mask on CAN socket!"); thread::spawn(move || loop { if !client.is_connected() {