Skip to main content

pamoja_lorawan_defrag_fragment

Function pamoja_lorawan_defrag_fragment 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_defrag_fragment( session: *mut PamojaLorawanDefrag, n: u16, fragment: *const u8, fragment_len: usize, out_done: *mut u8, ) -> PamojaStatus
Expand description

Takes one fragment of a session.

§Arguments

  • session - the session.
  • n - which fragment, counting from one.
  • fragment - its bytes.
  • fragment_len - how many, which must be at least the session’s fragment size.
  • out_done - receives 1 once the block is whole.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument for a fragment outside the session, and PamojaStatus::Other when more fragments were lost than there is room to solve for.

§Safety

session must be a live handle, fragment must point to fragment_len readable bytes, and out_done must be writable.