From a2ddd00bfec1fa0f16da093e72a5277641e39470 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Sun, 10 Aug 2008 05:39:21 +0000 Subject: [PATCH] Add SerialPortPoll Api in SerialPortLib to Poll the serial device to see if there is any data waiting. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5624 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/SerialPortLib.h | 16 +++++++++++++++ .../SerialPortLibNull/SerialPortLibNull.c | 20 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/MdePkg/Include/Library/SerialPortLib.h b/MdePkg/Include/Library/SerialPortLib.h index dc4031a974..59c5c27e3f 100644 --- a/MdePkg/Include/Library/SerialPortLib.h +++ b/MdePkg/Include/Library/SerialPortLib.h @@ -70,5 +70,21 @@ SerialPortRead ( IN UINTN NumberOfBytes ); +/** + Poll the serial device to see if there is any data waiting. + + If there is data waiting to be read from the serial port, then return + TRUE. If there is no data waiting to be read from the serial port, then + return FALSE. + + @retval TRUE Data is waiting to be read. + @retval FALSE There is no data waiting to be read. + +**/ +BOOLEAN +EFIAPI +SerialPortPoll ( + VOID + ); #endif diff --git a/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c b/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c index 1fdc6586a5..fa256facc7 100644 --- a/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c +++ b/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c @@ -73,3 +73,23 @@ SerialPortRead ( return 0; } +/** + Poll the serial device to see if there is any data waiting. + + If there is data waiting to be read from the serial port, then return + TRUE. If there is no data waiting to be read from the serial port, then + return FALSE. + + @retval FALSE There is no data waiting to be read. + +**/ +BOOLEAN +EFIAPI +SerialPortPoll ( + VOID + ) +{ + return FALSE; +} + + \ No newline at end of file -- 2.39.5