/** @file\r
Header file for Terminal driver.\r
\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r
LIST_ENTRY NotifyEntry;\r
} TERMINAL_CONSOLE_IN_EX_NOTIFY;\r
+\r
+typedef enum {\r
+ TerminalTypePcAnsi,\r
+ TerminalTypeVt100,\r
+ TerminalTypeVt100Plus,\r
+ TerminalTypeVtUtf8,\r
+ TerminalTypeTtyTerm\r
+} TERMINAL_TYPE;\r
+\r
typedef struct {\r
UINTN Signature;\r
EFI_HANDLE Handle;\r
- UINT8 TerminalType;\r
+ TERMINAL_TYPE TerminalType;\r
EFI_SERIAL_IO_PROTOCOL *SerialIo;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;\r
UINT8 Utf8_3[3];\r
} UTF8_CHAR;\r
\r
-#define PCANSITYPE 0\r
-#define VT100TYPE 1\r
-#define VT100PLUSTYPE 2\r
-#define VTUTF8TYPE 3\r
-#define TTYTERMTYPE 4\r
-\r
#define LEFTOPENBRACKET 0x5b // '['\r
#define ACAP 0x41\r
#define BCAP 0x42\r
@param This Protocol instance pointer.\r
@param KeyData A pointer to a buffer that is filled in with the\r
keystroke information data for the key that was\r
- pressed.\r
+ pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState\r
+ and KeyData.KeyState.KeyShiftState are 0, then any incomplete\r
+ keystroke will trigger a notification of the KeyNotificationFunction.\r
@param KeyNotificationFunction Points to the function to be called when the key\r
- sequence is typed specified by KeyData.\r
+ sequence is typed specified by KeyData. This notification function\r
+ should be called at <=TPL_CALLBACK.\r
@param NotifyHandle Points to the unique handle assigned to the\r
registered notification.\r
\r
**/\r
EFI_STATUS\r
SetTerminalDevicePath (\r
- IN UINT8 TerminalType,\r
+ IN TERMINAL_TYPE TerminalType,\r
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath\r
);\r
\r
/**\r
Remove one pre-fetched key out of the Unicode FIFO buffer.\r
- The caller should guarantee that Unicode FIFO buffer is not empty \r
+ The caller should guarantee that Unicode FIFO buffer is not empty\r
by IsUnicodeFiFoEmpty ().\r
\r
@param TerminalDevice Terminal driver private structure.\r
Translate one Unicode character into VT-UTF8 characters.\r
\r
UTF8 Encoding Table\r
- Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding\r
- 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx\r
- 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx\r
- 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx\r
+ Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding\r
+ 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx\r
+ 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx\r
+ 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx\r
\r
\r
@param Unicode Unicode character need translating.\r
Translate VT-UTF8 characters into one Unicode character.\r
\r
UTF8 Encoding Table\r
- Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding\r
- 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx\r
- 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx\r
- 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx\r
+ Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding\r
+ 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx\r
+ 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx\r
+ 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx\r
\r
\r
@param Utf8Char VT-UTF8 character set needs translating.\r