can2mqtt 3.0.0

CAN-Bus -- MQTT bridge: bidirectional, configurable and extendable
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use core::fmt;
use std::fmt::Display;

use bytes::Bytes;
use can_socket::CanData;

pub type MQTTPayload = Bytes;
pub type CANFrame = CanData;

pub trait Converter: Display + fmt::Debug + Sync + Send {
    fn towards_mqtt(&self, cf: CANFrame) -> Result<MQTTPayload, String>;
    fn towards_can(&self, msg: MQTTPayload) -> Result<CANFrame, String>;
}