Skip to main content

descriptor

Function descriptor 

Source
pub fn descriptor(msgid: u32) -> Option<&'static MessageDescriptor<'static>>
Expand description

Returns the shape of a common-dialect message, if this crate types it.

§Arguments

  • msgid - the message id to look up.

§Returns

The descriptor, or None for an id outside the typed set; a caller can describe such a message itself with MessageDescriptorBuilder.

§Examples

use pamoja_mavlink::dialect::descriptor;

let heartbeat = descriptor(0).expect("HEARTBEAT is in the common dialect");
assert_eq!(heartbeat.name, "HEARTBEAT");
assert_eq!(heartbeat.wire_len(), 9);
assert!(descriptor(50_000).is_none());