2020-04-01 17:47:53 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 16:25:46 +08:00
|
|
|
#include <zephyr/device.h>
|
|
|
|
#include <zephyr/drivers/console/uart_mux.h>
|
2020-04-01 17:47:53 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Send data to real UART (the data should be muxed already)
|
|
|
|
*
|
|
|
|
* @param uart Muxed uart
|
|
|
|
* @param buf Data to send
|
|
|
|
* @param size Data length
|
|
|
|
*
|
2022-08-16 01:04:58 +08:00
|
|
|
* @return >=0 if data was sent (and number of bytes sent), <0 if error
|
2020-04-01 17:47:53 +08:00
|
|
|
*/
|
2020-05-01 02:33:38 +08:00
|
|
|
int uart_mux_send(const struct device *uart, const uint8_t *buf, size_t size);
|
2020-04-01 17:47:53 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Receive unmuxed data.
|
|
|
|
*
|
|
|
|
* @param mux UART mux device structure.
|
|
|
|
* @param uart Real UART device structure.
|
|
|
|
* @param dlci_address DLCI id for the virtual muxing channel
|
|
|
|
* @param timeout Amount of time to wait for the channel creation.
|
|
|
|
*
|
|
|
|
* @retval >=0 No errors, number of bytes received
|
|
|
|
* @retval <0 Error
|
|
|
|
*/
|
2020-05-01 02:33:38 +08:00
|
|
|
int uart_mux_recv(const struct device *mux, struct gsm_dlci *dlci,
|
2020-05-28 00:26:57 +08:00
|
|
|
uint8_t *data, size_t len);
|
2020-04-01 17:47:53 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|