Skip to main content

pamoja_mavlink_parser_push

Function pamoja_mavlink_parser_push 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_mavlink_parser_push( parser: *mut PamojaMavlinkParser, bytes: *const u8, bytes_len: usize, dialect: *const PamojaMavlinkDialect, ) -> PamojaStatus
Expand description

Feeds bytes off a link into the parser.

Whatever a serial port or socket delivers can be pushed as it arrives, however it is split. Frames that complete are queued for pamoja_mavlink_parser_next. Noise between frames is skipped rather than reported, which is what lets a parser join a stream already in progress.

§Arguments

  • parser - the parser to feed.
  • bytes - the bytes just read off the link.
  • bytes_len - how many bytes bytes holds.
  • dialect - the dialect to prefer, or null for the common one alone.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument if parser is null.

§Safety

parser must be a live parser handle, bytes must point to bytes_len readable bytes when the length is non-zero, and dialect must be a live dialect handle or null.