Skip to main content

pamoja_serial_port_pair

Function pamoja_serial_port_pair 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_serial_port_pair( settings: PamojaSerialSettings, out_one: *mut *mut PamojaSerialPort, out_other: *mut *mut PamojaSerialPort, ) -> PamojaStatus
Expand description

Creates the two ends of a null-modem pair: what one end writes, the other reads.

§Arguments

  • settings - the speed and format both ends run at.
  • out_one - receives one end.
  • out_other - receives the other end.

§Returns

PamojaStatus::Ok with both ends set, each released with pamoja_serial_port_free; or PamojaStatus::InvalidArgument for a null out pointer or settings the port does not have.

§Safety

out_one and out_other must be writable pointers or null.