Skip to main content

pamoja_mavlink_message_set_bytes

Function pamoja_mavlink_message_set_bytes 

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

Writes the raw bytes of a byte-wide array field, zero-padding the rest.

This is how a char array carrying text is written: pass the text’s bytes and the field is padded to its declared length.

§Arguments

  • message - the message to write.
  • field - the field name.
  • bytes - the bytes to store, at most the field’s declared length.
  • bytes_len - the number of bytes to store.

§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 bytes are longer than the field.

§Safety

message must be a live message handle, field a null-terminated C string, and bytes must point at bytes_len readable bytes.