35#include "ove_config.h"
43#ifdef CONFIG_OVE_STREAM
142 uint64_t deadline_ns,
size_t *bytes_sent)
166 size_t *bytes_received);
186 uint64_t deadline_ns,
size_t *bytes_received)
int ove_stream_init(ove_stream_t *stream, ove_stream_storage_t *storage, void *buffer, size_t size, size_t trigger)
Initialise a stream using caller-provided static storage.
int ove_stream_send(ove_stream_t stream, const void *data, size_t len, uint64_t timeout_ns, size_t *bytes_sent)
Send bytes into the stream from task context.
static int ove_stream_receive_until(ove_stream_t stream, void *buf, size_t len, uint64_t deadline_ns, size_t *bytes_received)
Deadline-based variant of ove_stream_receive.
Definition stream.h:185
int ove_stream_receive(ove_stream_t stream, void *buf, size_t len, uint64_t timeout_ns, size_t *bytes_received)
Receive bytes from the stream in task context.
int ove_stream_send_from_isr(ove_stream_t stream, const void *data, size_t len, size_t *bytes_sent)
Send bytes into the stream from an ISR.
void ove_stream_destroy(ove_stream_t stream)
Destroy a heap-allocated stream.
void ove_stream_deinit(ove_stream_t stream)
Deinitialise a statically-allocated stream.
size_t ove_stream_bytes_available(ove_stream_t stream)
Query the number of bytes currently available in the stream.
int ove_stream_create(ove_stream_t *stream, size_t size, size_t trigger)
Allocate and initialise a heap-backed stream.
int ove_stream_set_notify(ove_stream_t stream, ove_notify_cb cb, void *user_data)
Register a notify callback fired after every successful send.
int ove_stream_reset(ove_stream_t stream)
Discard all bytes currently held in the stream.
int ove_stream_receive_from_isr(ove_stream_t stream, void *buf, size_t len, size_t *bytes_received)
Receive bytes from the stream from an ISR.
static int ove_stream_send_until(ove_stream_t stream, const void *data, size_t len, uint64_t deadline_ns, size_t *bytes_sent)
Deadline-based variant of ove_stream_send.
Definition stream.h:141
static uint64_t ove_time_deadline_to_timeout_ns(uint64_t deadline_ns)
Convert a steady-clock deadline to a duration suitable for the existing timeout_ns-taking APIs.
Definition time.h:162
struct ove_stream * ove_stream_t
Opaque handle for a byte-stream (ring-buffer) object.
Definition types.h:232
void(* ove_notify_cb)(void *user_data)
Notify-callback signature used by the _set_notify variants of the comm primitives (stream / queue / e...
Definition types.h:298
@ OVE_ERR_NOT_SUPPORTED
Definition types.h:98