aura
0.1
|
#include <aura.h>
Data Fields | |
const char * | name |
Required. More... | |
uint32_t | flags |
Optional. More... | |
int | buffer_overhead |
Optional. More... | |
int | buffer_offset |
Optional. More... | |
int(* | open )(struct aura_node *node, const char *opts) |
Required. More... | |
void(* | close )(struct aura_node *node) |
Required. More... | |
void(* | loop )(struct aura_node *node, const struct aura_pollfds *fd) |
Required. More... | |
void(* | buffer_put )(struct aura_buffer *dst, struct aura_buffer *buf) |
Optional. More... | |
struct aura_buffer *(* | buffer_get )(struct aura_buffer *buf) |
Optional. More... | |
struct aura_buffer *(* | buffer_request )(struct aura_node *node, int size) |
Optional. More... | |
void(* | buffer_release )(struct aura_buffer *buf) |
Optional. More... | |
int | usage |
Private. More... | |
struct list_head | registry |
Private. More... | |
struct aura_buffer*(* aura_transport::buffer_get)(struct aura_buffer *buf) |
Optional.
Your transport may implement passing aura_buffers as arguments. This may be extremely useful for DSP applications, where you also implement your own buffer_request and buffer_release to take care of allocating memory on the DSP side. This function should deserialize and return aura_buffer from buffer buf
buf | |
ptr |
int aura_transport::buffer_offset |
int aura_transport::buffer_overhead |
Optional.
Additional bytes to allocate for each buffer.
If your transport layer requires any additional bytes to encapsulate the actual serialized message - just specify how many. This is node to avoid unneeded copying while formatting the message for transmission in the transport layer.
void(* aura_transport::buffer_put)(struct aura_buffer *dst, struct aura_buffer *buf) |
Optional.
Your transport may implement passing aura_buffers as arguments. This may be extremely useful for DSP applications, where you also implement your own buffer_request and buffer_release to take care of allocating memory on the DSP side. This function should serialize buffer buf into buffer dst. Buffer pointer/handle must be cast to uint64_t.
buf |
void(* aura_transport::buffer_release)(struct aura_buffer *buf) |
struct aura_buffer*(* aura_transport::buffer_request)(struct aura_node *node, int size) |
Optional.
Override Buffer allocation. This may be called if you need any special consideration when allocating buffers (e.g. ION). The size includes any transport-required overhead, but doesn't include the actual struct aura_buffer or any of your own data. Your code should set (struct aura_buffer *)->data field to point to the actual data
The simplest implementation would be:
node | current node |
size | requested buffer size (NOT including struct aura_buffer) |
void(* aura_transport::close)(struct aura_node *node) |
uint32_t aura_transport::flags |
void(* aura_transport::loop)(struct aura_node *node, const struct aura_pollfds *fd) |
Required.
The workhorse of your transport plugin.
This function should check the node->outbound_buffers queue for any new messages to deliver and place any incoming messages into node->inbound_buffers queue.
This function is called by the core when:
node | current node |
fd | pointer to struct aura_pollfds that generated an event. |
const char* aura_transport::name |
int(* aura_transport::open)(struct aura_node *node, const char *opts) |
Required.
Open function.
Open function should perform sanity checking on supplied (in ap) arguments and allocate internal data structures and set required periodic timeout in the respective node. See transport-dummy.c for a boilerplate.
Avoid doing any blocking stuff in open(), do in in loop instead in non-blocking fashion.
node | current node |
opts | string containing transport-specific options |
struct list_head aura_transport::registry |