Difference between revisions of "Serial Read"

From WikiPrizm
Jump to navigationJump to search
 
Line 6: Line 6:
 
| synopsis = Reads bytes from the serial receive buffer.
 
| synopsis = Reads bytes from the serial receive buffer.
 
| parameters =
 
| parameters =
* '''out''': Buffer to write received data to.
+
* '''out''' - Buffer to write received data to.
* '''sz''': Maximum number of bytes to read.
+
* '''sz''' - Maximum number of bytes to read.
* '''count''': Output parameter receiving the number of bytes actually read.
+
* '''count''' - Output parameter receiving the number of bytes actually read.
| returns = 0 if successful, 1 if the receive buffer is empty, and 3 if the serial channel is not [[Serial_Open|open]]. If successful, the actual number of bytes read is returned in ''count''.
+
| returns = * 0 if successful,
 +
* 1 if the receive buffer is empty,
 +
* 3 if the serial channel is not [[Serial_Open|open]].
 +
If successful, the actual number of bytes read is returned in ''count''.
 
| comments = The receive buffer can hold up to 1024 bytes.  Its behavior on overflow is unknown.
 
| comments = The receive buffer can hold up to 1024 bytes.  Its behavior on overflow is unknown.
  

Latest revision as of 06:25, 1 August 2014


Synopsis

Header: fxcg/serial.h
Syscall index: 0x1BBA
Function signature: int Serial_Read(unsigned char *out, int sz, short *count)

Reads bytes from the serial receive buffer.

Parameters

  • out - Buffer to write received data to.
  • sz - Maximum number of bytes to read.
  • count - Output parameter receiving the number of bytes actually read.

Returns

  • 0 if successful,
  • 1 if the receive buffer is empty,
  • 3 if the serial channel is not open.

If successful, the actual number of bytes read is returned in count.

Comments

The receive buffer can hold up to 1024 bytes. Its behavior on overflow is unknown.

Originally documented as Serial_ReadNBytes.