Serial Peek

From WikiPrizm
Revision as of 06:34, 1 August 2014 by Gbl08ma (talk | contribs) (Created page with "{{syscall | name = Serial_Peek | header = fxcg/serial.h | index = 0x1BBB (not yet included in libfxcg!) | signature = int Serial_Peek(int idx, unsigned char* out) | synopsis =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Synopsis

Header: fxcg/serial.h
Syscall index: 0x1BBB (not yet included in libfxcg!)
Function signature: int Serial_Peek(int idx, unsigned char* out)

Reads, without removing, a single byte from a specified position in the serial input buffer.

Parameters

  • idx - index in the input buffer of the byte to read;
  • out - pointer to unsigned char that will receive the fetched byte.

Returns

  • 0 if successful,
  • 1 if the required byte is not available (there are less bytes in the buffer than idx),
  • 3 if the serial channel is not open.