Skip to content

Get spns of a pgn? #26

Description

@abalmos

I am working on a tool that parses a can stream based on a dbc file in real time. I don't really have specific messages of interests (like the example), but rather, I want to parse all can frames that match to DBC.

Something like:

let lib = PgnLibrary::from_dbc_file("./j1939.dbc");

loop {
  let msg = s.recv()?;

  let Some(pgnDef) = lib.get_pgn(msg.pgn) {
    let d = pgnDef.spns.iter().map(|(s, def)| (s, def.parse_message(msg.data)?));
  }
  
  // Export `d` to database

}

Currently this does not compile because spns is a private member. Do you intend to support this? If so, I would be willing to offer a PR based on how you want to approach it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions