From b369d2e97faea9585ac3465570e3531f6fe3d998 Mon Sep 17 00:00:00 2001 From: haizhouyang Date: Wed, 28 Apr 2021 11:05:48 +0800 Subject: [PATCH] add UartHostPollEvent --- support/platform/include/uart_core.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/support/platform/include/uart_core.h b/support/platform/include/uart_core.h index 2757d7590..44bc5f324 100644 --- a/support/platform/include/uart_core.h +++ b/support/platform/include/uart_core.h @@ -41,7 +41,8 @@ struct UartHostMethod { int32_t (*SetBaud)(struct UartHost *host, uint32_t baudRate); int32_t (*GetAttribute)(struct UartHost *host, struct UartAttribute *attribute); int32_t (*SetAttribute)(struct UartHost *host, struct UartAttribute *attribute); - int32_t (*SetTransMode)(struct UartHost *handle, enum UartTransMode mode); + int32_t (*SetTransMode)(struct UartHost *host, enum UartTransMode mode); + int32_t (*pollEvent)(struct UartHost *host, void *filep, void *table); }; struct UartHost *UartHostCreate(struct HdfDeviceObject *device); @@ -133,6 +134,14 @@ static inline int32_t UartHostSetTransMode(struct UartHost *host, enum UartTrans return host->method->SetTransMode(host, mode); } +static inline int32_t UartHostPollEvent(struct UartHost *host, void *filep, void *table) +{ + if (host == NULL || host->method == NULL || host->method->pollEvent == NULL) { + return HDF_ERR_NOT_SUPPORT; + } + return host->method->pollEvent(host, filep, table); +} + #ifdef __cplusplus #if __cplusplus } -- Gitee