Function pros_sys::serial::serial_write

source ·
pub unsafe extern "C" fn serial_write(
    port: u8,
    buffer: *mut u8,
    length: i32
) -> i32
Expand description

Writes up to length bytes from the user supplied buffer to the port’s output buffer.

\note Data in the port’s output buffer is written to the serial port as soon as possible on a FIFO basis and can not be done manually by the user.

This function uses the following values of errno when an error state is reached: EINVAL - The given value is not within the range of V5 ports (1-21). EACCES - Another resource is currently trying to access the port. EIO - Serious internal write error.

\param port The V5 port number from 1-21 \param buffer The data to write \param length The maximum number of bytes to write

\return The number of bytes written or PROS_ERR if the operation failed, setting errno.