Skip to main content

pamoja_mavlink_message_get_bytes

Function pamoja_mavlink_message_get_bytes 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_message_get_bytes( message: *const PamojaMavlinkMessage, field: *const c_char, out_bytes: *mut u8, out_bytes_len: usize, ) -> PamojaStatus
Expand description

Copies the raw bytes of a byte-wide array field out.

This is how a char array carrying text is read: the bytes come back padded with zeros, and the caller stops at the first one.

§Arguments

  • message - the message to read.
  • field - the field name.
  • out_bytes - the destination, which must hold at least the field’s length.
  • out_bytes_len - the space available at out_bytes.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument if a pointer is null, the message has no such field, the field is not a byte-wide array, or the destination is too small.

§Safety

message must be a live message handle, field a null-terminated C string, and out_bytes must point at out_bytes_len writable bytes.