Skip to main content

pamoja_mavlink_message_crc_extra

Function pamoja_mavlink_message_crc_extra 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_message_crc_extra( name: *const c_char, fields: *const PamojaMavlinkField, field_count: usize, out_crc_extra: *mut u8, ) -> PamojaStatus
Expand description

Derives the CRC_EXTRA seed of a message from its definition.

This is what makes a dialect this build has never seen usable: given a message’s name and its fields in wire order, the seed comes out the same as the one the dialect publishes, and a frame carrying that message then checks like any other.

§Arguments

  • name - the message name, such as HEARTBEAT.
  • fields - the base fields in wire order; extension fields are excluded from the seed and must not be listed.
  • field_count - how many fields fields holds.
  • out_crc_extra - set to the seed on success.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument if any pointer is null or any name is not valid UTF-8.

§Safety

name must be a valid null-terminated string, fields must point to field_count readable entries whose own pointers are valid null-terminated strings, and out_crc_extra must point at writable storage for one byte.