# UART ## Overview In the Hardware Driver Foundation \(HDF\), the Universal Asynchronous Receiver/Transmitter \(UART\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage. **Figure 1** Independent service mode  ## Available APIs UartHostMethod ``` struct UartHostMethod { int32_t (*Init)(struct UartHost *host); int32_t (*Deinit)(struct UartHost *host); int32_t (*Read)(struct UartHost *host, uint8_t *data, uint32_t size); int32_t (*Write)(struct UartHost *host, uint8_t *data, uint32_t size); int32_t (*GetBaud)(struct UartHost *host, uint32_t *baudRate); 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 *host, enum UartTransMode mode); int32_t (*pollEvent)(struct UartHost *host, void *filep, void *table); }; ``` **Table 1** Callbacks for the members in the UartHostMethod structure