Lines Matching full:pipe
18 * @brief Modem Pipe
19 * @defgroup modem_pipe Modem Pipe
24 /** Modem pipe event */
42 typedef void (*modem_pipe_api_callback)(struct modem_pipe *pipe, enum modem_pipe_event event,
74 * @brief Initialize a modem pipe
76 * @param pipe Pipe instance to initialize
77 * @param data Pipe data to bind to pipe instance
78 * @param api Pipe API implementation to bind to pipe instance
80 void modem_pipe_init(struct modem_pipe *pipe, void *data, const struct modem_pipe_api *api);
87 * @brief Open pipe
89 * @param pipe Pipe instance
90 * @param timeout Timeout waiting for pipe to open
92 * @retval 0 if pipe was successfully opened or was already open
97 * can result in a deadlock until this call times out waiting for the pipe to be open.
99 int modem_pipe_open(struct modem_pipe *pipe, k_timeout_t timeout);
102 * @brief Open pipe asynchronously
104 * @param pipe Pipe instance
106 * @note The MODEM_PIPE_EVENT_OPENED event is invoked immediately if pipe is
109 * @retval 0 if pipe open was called successfully or pipe was already open
112 int modem_pipe_open_async(struct modem_pipe *pipe);
115 * @brief Attach pipe to callback
117 * @param pipe Pipe instance
118 * @param callback Callback called when pipe event occurs
121 * @note The MODEM_PIPE_EVENT_RECEIVE_READY event is invoked immediately if pipe has pending
124 void modem_pipe_attach(struct modem_pipe *pipe, modem_pipe_api_callback callback, void *user_data);
127 * @brief Transmit data through pipe
129 * @param pipe Pipe to transmit through
133 * @retval Number of bytes placed in pipe
134 * @retval -EPERM if pipe is closed
139 int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size);
142 * @brief Receive data through pipe
144 * @param pipe Pipe to receive from
148 * @retval Number of bytes received from pipe
149 * @retval -EPERM if pipe is closed
154 int modem_pipe_receive(struct modem_pipe *pipe, uint8_t *buf, size_t size);
159 * @param pipe Pipe instance
161 void modem_pipe_release(struct modem_pipe *pipe);
164 * @brief Close pipe
166 * @param pipe Pipe instance
167 * @param timeout Timeout waiting for pipe to close
169 * @retval 0 if pipe open was called closed or pipe was already closed
174 * can result in a deadlock until this call times out waiting for the pipe to be closed.
176 int modem_pipe_close(struct modem_pipe *pipe, k_timeout_t timeout);
179 * @brief Close pipe asynchronously
181 * @param pipe Pipe instance
183 * @note The MODEM_PIPE_EVENT_CLOSED event is invoked immediately if pipe is
186 * @retval 0 if pipe close was called successfully or pipe was already closed
189 int modem_pipe_close_async(struct modem_pipe *pipe);
196 * @brief Notify user of pipe that it has opened
198 * @param pipe Pipe instance
200 * @note Invoked from instance which initialized the pipe instance
202 void modem_pipe_notify_opened(struct modem_pipe *pipe);
205 * @brief Notify user of pipe that it has closed
207 * @param pipe Pipe instance
209 * @note Invoked from instance which initialized the pipe instance
211 void modem_pipe_notify_closed(struct modem_pipe *pipe);
214 * @brief Notify user of pipe that data is ready to be received
216 * @param pipe Pipe instance
218 * @note Invoked from instance which initialized the pipe instance
220 void modem_pipe_notify_receive_ready(struct modem_pipe *pipe);
223 * @brief Notify user of pipe that pipe has no more data to transmit
225 * @param pipe Pipe instance
227 * @note Invoked from instance which initialized the pipe instance
229 void modem_pipe_notify_transmit_idle(struct modem_pipe *pipe);