vex_sdk::serial

Function vexSerialWriteBuffer

Source
pub unsafe fn vexSerialWriteBuffer(
    channel: u32,
    data: *const u8,
    data_len: u32,
) -> i32
Expand description

Writes an arbitrary buffer to the serial FIFO output buffer, returning how many bytes were written. The output buffer has a maximum size of 2048 bytes, meaning that a larger buffer may be truncated.

§Arguments

  • channel: The serial communications channel to write to. Use 1 for stdio.
  • data: A buffer of bytes to write.
  • data_len: The length of the specified buffer.

§Return

The number of bytes written, or -1 if an internal error occurred.

§Safety

Calls to jumptable functions are unsafe because jumptable functions are owned by VEXos and we cannot guarantee their safety.