Skip to main content

pamoja_serial_port_scripted

Function pamoja_serial_port_scripted 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_serial_port_scripted( settings: PamojaSerialSettings, script: *const PamojaSerialScript, ) -> *mut PamojaSerialPort
Expand description

Creates a port that plays a script: each write has to be the one the script expects next, and the bytes the far end sends become readable as the script reaches them.

§Arguments

  • settings - the speed and format the line runs at.
  • script - the steps to copy; the caller still owns the handle.

§Returns

The port, which the caller releases with pamoja_serial_port_free, or null for a null script or settings the port does not have.

§Safety

script must be a live handle or null.