Skip to main content

pamoja_mavlink_frame_parse

Function pamoja_mavlink_frame_parse 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_frame_parse( bytes: *const u8, bytes_len: usize, crc_extra: u8, out_frame: *mut *mut PamojaMavlinkFrame, ) -> PamojaStatus
Expand description

Parses one frame, checking it against a known CRC_EXTRA.

§Arguments

  • bytes - the frame as received.
  • bytes_len - how many bytes bytes holds.
  • crc_extra - the seed for the message the frame carries.
  • out_frame - set to the frame handle on success, and to null otherwise.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument if out_frame is null, and PamojaStatus::Codec if the bytes are not a whole frame or the checksum does not match, which is what rejects a frame mangled in transit.

§Safety

bytes must point to bytes_len readable bytes when the length is non-zero, and out_frame must point at writable storage for one pointer.