Skip to content

Commit

Permalink
Set CAN Socket to accept errors
Browse files Browse the repository at this point in the history
  • Loading branch information
harrison-e committed Oct 3, 2024
1 parent 8b77d80 commit d0f191c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/#";

Expand Down Expand Up @@ -57,6 +57,7 @@ fn read_can(pub_path: &str, can_interface: &str) -> JoinHandle<u32> {
}

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() {
Expand Down

0 comments on commit d0f191c

Please sign in to comment.