Line data Source code
1 0 : /*
2 : * Copyright (c) 2022 Trackunit Corporation
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #include <zephyr/kernel.h>
8 : #include <zephyr/types.h>
9 : #include <zephyr/device.h>
10 : #include <zephyr/sys/ring_buffer.h>
11 : #include <zephyr/sys/atomic.h>
12 :
13 : #include <zephyr/modem/pipe.h>
14 :
15 : #ifndef ZEPHYR_MODEM_BACKEND_TTY_
16 0 : #define ZEPHYR_MODEM_BACKEND_TTY_
17 :
18 : #ifdef __cplusplus
19 : extern "C" {
20 : #endif
21 :
22 0 : struct modem_backend_tty {
23 0 : const char *tty_path;
24 0 : int tty_fd;
25 0 : struct modem_pipe pipe;
26 0 : struct k_thread thread;
27 0 : k_thread_stack_t *stack;
28 0 : size_t stack_size;
29 0 : atomic_t state;
30 : };
31 :
32 0 : struct modem_backend_tty_config {
33 0 : const char *tty_path;
34 0 : k_thread_stack_t *stack;
35 0 : size_t stack_size;
36 : };
37 :
38 0 : struct modem_pipe *modem_backend_tty_init(struct modem_backend_tty *backend,
39 : const struct modem_backend_tty_config *config);
40 :
41 : #ifdef __cplusplus
42 : }
43 : #endif
44 :
45 : #endif /* ZEPHYR_MODEM_BACKEND_TTY_ */
|