HardwareSerial::peek()
Abstract
The Serial.peek()/HardwareSerial::peek() reads data from receive buffer without modifying the buffer.
Souce Code
The HardwareSerial::peek() is defined in hardware/arduino/avr/cores/arduino/HardwareSerial.cpp as below.
|
|
No inputs, output is int.
|
|
If the head and tail of the buffer is same, there is no data in the buffer, returns -1.
|
|
If the head and tail of the buffer is not same, return the oldest data which is stored in buffer[tail].
|
|
This function dose not modify the receive buffer itself.
Version
Arduino AVR Boards 1.8.6
Last Update
August 25, 2019