Skip to main content

pamoja_mavlink_message_get_number

Function pamoja_mavlink_message_get_number 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_message_get_number( message: *const PamojaMavlinkMessage, field: *const c_char, index: usize, out_value: *mut f64, ) -> PamojaStatus
Expand description

Reads a field as a double, whatever its type.

This is the reading a host language with one numeric type needs. An integer field wider than 53 bits can exceed what a double holds exactly, so read those with pamoja_mavlink_message_get_int or pamoja_mavlink_message_get_uint where the exact value matters.

§Arguments

  • message - the message to read.
  • field - the field name.
  • index - the element to read, or 0 for a scalar field.
  • out_value - set to the value on success.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument if a pointer is null, the message has no such field, or the element is past the end of an array.

§Safety

message must be a live message handle, field a null-terminated C string, and out_value must point at writable storage for one double.