Skip to main content

pamoja_lorawan_frag_fragment

Function pamoja_lorawan_frag_fragment 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_frag_fragment( block: *const u8, block_len: usize, frag_size: u8, n: u16, out_fragment: *mut u8, out_len: usize, ) -> PamojaStatus
Expand description

Builds one fragment of a session out of a block held whole.

§Arguments

  • block - the block to send.
  • block_len - its length.
  • frag_size - how many bytes each fragment carries.
  • n - which fragment, counting from one; past the uncoded ones it is a coded fragment.
  • out_fragment - receives the fragment.
  • out_len - how many bytes that buffer holds, at least frag_size.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument for a null pointer, a session this build does not run, or a buffer too small.

§Safety

block must point to block_len readable bytes and out_fragment to out_len writable ones.