1 /*
2  * Copyright (c) 2020 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/device.h>
8 #include <zephyr/drivers/console/uart_mux.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /**
15  * @brief Send data to real UART (the data should be muxed already)
16  *
17  * @param uart Muxed uart
18  * @param buf Data to send
19  * @param size Data length
20  *
21  * @return >=0 if data was sent (and number of bytes sent), <0 if error
22  */
23 int uart_mux_send(const struct device *uart, const uint8_t *buf, size_t size);
24 
25 /**
26  * @brief Receive unmuxed data.
27  *
28  * @param mux UART mux device structure.
29  * @param dlci DLCI id for the muxing channel that should receive the data.
30  * @param data Received data (already unmuxed)
31  * @param len Length of the received data
32  *
33  * @retval >=0 No errors, number of bytes received
34  * @retval <0 Error
35  */
36 int uart_mux_recv(const struct device *mux, struct gsm_dlci *dlci,
37 		  uint8_t *data, size_t len);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42