An ARINC 429 message
The bits of a message are represented exactly as transmitted on the wires, with the least
significant bit transmitted first.
The label field is in the 8 least significant bits. Because the most significant digit of the
label is transmitted first, the label field is in the reverse of the usual bit order.
The parity bit is the most significant bit.
The u32::from(Message)
and Message::from(u32)
From
implementations copy bits with no
changes.
Some ARINC 429 adapters use a different representation, where the bits of the label field are
reversed from their on-wire representation. The methods Message::from_bits_label_swapped()
and
Message::bits_label_swapped()
implement this conversion.
Conversions never panic.
Create a message
let message = Message::from(0x10000056);
assert_eq!(0x10000056, u32::from(message));
Label bit swapping
let message = Message::from_bits_label_swapped(0x10000056);
assert_eq!(0x1000006a, u32::from(message));
Returns the bits that represent this message
Returns the bits of this message, but
with the order of the 8 label bits reversed.
Creates a message from a message representation with the 8 label bits
reversed. The returned Msg429 will be represented as transmitted on the wires.
Checks the parity of this message, and returns an error if the parity is not odd
assert!(Message::from(0x0).check_parity().is_err());
assert!(Message::from(0xf03ccccc).check_parity().is_err());
assert!(Message::from(0x1).check_parity().is_ok());
assert!(Message::from(0xf13ccccc).check_parity().is_ok());
Calculates the parity of this message and returns a new message with the parity bit (31) to
the correct value
let message = Message::from(0x22443300);
assert_eq!(message.update_parity().bits(), 0xa2443300);
let message = Message::from(0x22443301);
assert_eq!(message.update_parity(), message);
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Returns the "default value" for a type. Read more
Creates a message from bits as transmitted, with no modifications
Converts a message into bits, with no modifications