Skip to main content

pamoja_mavlink_mission_receiver_on_frame

Function pamoja_mavlink_mission_receiver_on_frame 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_mission_receiver_on_frame( receiver: *mut PamojaMavlinkMissionReceiver, frame: *const PamojaMavlinkFrame, header: PamojaMavlinkHeader, out_kind: *mut u32, out_accepted: *mut *mut PamojaMavlinkMessage, out_reply: *mut *mut PamojaMavlinkFrame, ) -> PamojaStatus
Expand description

Handles an incoming frame, if it is one this transfer is waiting for.

A MISSION_COUNT opens the transfer and a MISSION_ITEM_INT advances it. Any other message sets out_kind to PAMOJA_MAVLINK_STEP_IGNORED and produces nothing.

§Arguments

  • receiver - the transfer.
  • frame - the frame off the link.
  • header - the addressing fields to stamp on the reply.
  • out_kind - set to PAMOJA_MAVLINK_RECEIVER_REQUEST, PAMOJA_MAVLINK_RECEIVER_ACK, or PAMOJA_MAVLINK_STEP_IGNORED.
  • out_accepted - set to the MISSION_ITEM_INT the frame carried if it was the one expected next, as a message the caller reads by field name and releases with pamoja_mavlink_message_free, or to null.
  • out_reply - set to the frame to send back, which the caller releases with pamoja_mavlink_frame_free, or to null if the frame was ignored.

§Returns

PamojaStatus::Ok on success, including when the frame was ignored.

§Errors

Returns PamojaStatus::InvalidArgument if any pointer is null.

§Safety

receiver must be a live receiver handle, frame a live frame handle, and each out pointer must point at writable storage for its value.