pub struct Parser {
pub bus: Bus,
}Expand description
MIL-STD-1553B protocol parser
Fields§
§bus: BusCurrent bus context
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse_word(&self, data: &[u8]) -> Result<Word>
pub fn parse_word(&self, data: &[u8]) -> Result<Word>
Parse a single word from Manchester-encoded bytes
Expects 5 bytes (40 bits) of Manchester-encoded data representing 20 bits
Sourcepub fn parse_transaction(&self, data: &[u8]) -> Result<Transaction>
pub fn parse_transaction(&self, data: &[u8]) -> Result<Transaction>
Parse a command-response transaction
A typical transaction consists of:
- Command word (from Bus Controller)
- Optional data words (if receive command)
- Status word (from Remote Terminal)
- Optional response data words
Sourcepub fn encode_command(&self, command: &Command) -> Result<Vec<u8>>
pub fn encode_command(&self, command: &Command) -> Result<Vec<u8>>
Encode and transmit a command
Sourcepub fn encode_status(&self, status: &StatusWord) -> Result<Vec<u8>>
pub fn encode_status(&self, status: &StatusWord) -> Result<Vec<u8>>
Encode a status word
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more