diff --git a/support/platform/include/uart_core.h b/support/platform/include/uart_core.h index 2757d7590aff356ffadb1947f8904523253aba02..44bc5f3249ba61981c0fc27024599c47eb745b67 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 }