Skip to main content

pamoja_mesh_frame_parse

Function pamoja_mesh_frame_parse 

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

Parses a frame received off a radio.

§Arguments

  • bytes - the frame exactly as it arrived.
  • bytes_len - its length.
  • out_frame - receives the parsed frame.

§Returns

PamojaStatus::Ok on success, with *out_frame set to a handle the caller must release with pamoja_mesh_frame_free, or PamojaStatus::Codec if the frame is truncated, of an unknown version, or fails its checksum.

§Safety

bytes must point to at least bytes_len readable bytes when that length is non-zero, and out_frame must point to a writable *mut PamojaMeshFrame.