Skip to main content

pamoja_slip_decoder_feed

Function pamoja_slip_decoder_feed 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_slip_decoder_feed( decoder: *mut PamojaSlipDecoder, bytes: *const u8, bytes_len: usize, out_frames: *mut *mut PamojaFrames, ) -> PamojaStatus
Expand description

Feeds a chunk of the byte stream to a SLIP decoder.

§Returns

PamojaStatus::Ok on success, with *out_frames set to a new handle holding every frame this chunk completed, in order, which the caller must release with pamoja_frames_free. A chunk that completes no frame yields an empty handle rather than an error.

§Safety

decoder must be a live handle from pamoja_slip_decoder_new, bytes must point to at least bytes_len readable bytes or be null when bytes_len is 0, and out_frames must point to a writable *mut PamojaFrames.