#[unsafe(no_mangle)]pub unsafe extern "C" fn pamoja_mesh_frame_new(
src: u32,
dst: u32,
id: u16,
payload: *const u8,
payload_len: usize,
out_frame: *mut *mut PamojaMeshFrame,
) -> PamojaStatusExpand description
Builds a mesh frame addressed to one node.
§Arguments
src- the address of this node.dst- the address the frame is for, orPAMOJA_MESH_BROADCAST.id- the sequence number identifying this packet from this source.payload- the bytes to carry.payload_len- the payload length in bytes.out_frame- receives the new frame.
§Returns
PamojaStatus::Ok on success, with *out_frame set to a handle the caller
must release with pamoja_mesh_frame_free, or
PamojaStatus::InvalidArgument if the payload is larger than
PAMOJA_MESH_PAYLOAD_MAX.
§Safety
payload must point to at least payload_len readable bytes when that length
is non-zero, and out_frame must point to a writable *mut PamojaMeshFrame.