10#ifndef ZEPHYR_MODEM_PIPE_
11#define ZEPHYR_MODEM_PIPE_
49typedef int (*modem_pipe_api_open)(
void *data);
51typedef int (*modem_pipe_api_transmit)(
void *data,
const uint8_t *buf,
size_t size);
53typedef int (*modem_pipe_api_receive)(
void *data,
uint8_t *buf,
size_t size);
55typedef int (*modem_pipe_api_close)(
void *data);
57struct modem_pipe_api {
58 modem_pipe_api_open
open;
59 modem_pipe_api_transmit transmit;
60 modem_pipe_api_receive receive;
61 modem_pipe_api_close
close;
66 const struct modem_pipe_api *api;
80void modem_pipe_init(
struct modem_pipe *pipe,
void *data,
const struct modem_pipe_api *api);
202void modem_pipe_notify_opened(
struct modem_pipe *pipe);
211void modem_pipe_notify_closed(
struct modem_pipe *pipe);
220void modem_pipe_notify_receive_ready(
struct modem_pipe *pipe);
229void modem_pipe_notify_transmit_idle(
struct modem_pipe *pipe);
int open(const char *name, int flags,...)
static int close(int sock)
POSIX wrapper for zsock_close.
Definition socket.h:828
int modem_pipe_open_async(struct modem_pipe *pipe)
Open pipe asynchronously.
int modem_pipe_close(struct modem_pipe *pipe, k_timeout_t timeout)
Close pipe.
void modem_pipe_attach(struct modem_pipe *pipe, modem_pipe_api_callback callback, void *user_data)
Attach pipe to callback.
int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size)
Transmit data through pipe.
int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout)
Open pipe.
int modem_pipe_close_async(struct modem_pipe *pipe)
Close pipe asynchronously.
int modem_pipe_receive(struct modem_pipe *pipe, uint8_t *buf, size_t size)
Receive data through pipe.
modem_pipe_event
Modem pipe event.
Definition pipe.h:25
void modem_pipe_release(struct modem_pipe *pipe)
Clear callback.
void(* modem_pipe_api_callback)(struct modem_pipe *pipe, enum modem_pipe_event event, void *user_data)
Definition pipe.h:42
@ MODEM_PIPE_EVENT_RECEIVE_READY
Definition pipe.h:27
@ MODEM_PIPE_EVENT_OPENED
Definition pipe.h:26
@ MODEM_PIPE_EVENT_TRANSMIT_IDLE
Definition pipe.h:28
@ MODEM_PIPE_EVENT_CLOSED
Definition pipe.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Event Structure.
Definition kernel.h:2301
Kernel Spin Lock.
Definition spinlock.h:45
Kernel timeout type.
Definition sys_clock.h:65