canboat_rs/pgns/
fusion_set_source.rs

1use crate::pgn_types::PgnType;
2pub const LENGTH: usize = 5usize;
3pub const PGN: u32 = 126720u32;
4use bitfield::bitfield;
5bitfield! {
6    #[doc = "Fusion: Set Source"] pub struct FusionSetSource([u8]); impl Debug; u32; pub
7    manufacturer_code, _ : 10usize, 0usize; pub reserved, _ : 12usize, 11usize; pub
8    industry_code, _ : 15usize, 13usize; pub proprietary_id, _ : 23usize, 16usize; pub
9    unknown, _ : 31usize, 24usize; pub source_id, _ : 39usize, 32usize;
10}
11impl FusionSetSource<&[u8]> {
12    pub fn is_match(&self, pgn: u32) -> bool {
13        126720u32 == pgn && self.manufacturer_code() == 419u32
14            && self.industry_code() == 4u32 && self.proprietary_id() == 2u32
15    }
16    pub fn get_pgn() -> u32 {
17        126720u32
18    }
19    pub fn get_message_type() -> PgnType {
20        PgnType::Fast
21    }
22}