Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_flow_single_options Struct Reference

Structure for the specification of a single node. More...

#include <sol-flow-single.h>

Data Fields

struct sol_flow_node_options base
 base guarantees sol_flow_node_options compatibility. More...
 
const uint16_t * connected_ports_in
 indexes of input ports that should be connected. More...
 
const uint16_t * connected_ports_out
 indexes of output ports that should be connected. More...
 
const struct
sol_flow_node_options
options
 options to give to the actual base type. More...
 
void(* process )(void *user_data, struct sol_flow_node *node, uint16_t port, const struct sol_flow_packet *packet)
 callback to deliver outgoing packets. More...
 
const void * user_data
 user data to give to callback process(). More...
 

Detailed Description

Structure for the specification of a single node.

This option is used to instatiate a single-node that wrappes an inner node of a given type specified at sol_flow_single_new_type().

It is used internally by sol_flow_single_new() or explicitly by those calling sol_flow_new() manually.

It contains a struct sol_flow_node_options header (base) so it conforms to the options protocol. Be sure to fill its api_version with SOL_FLOW_NODE_OPTIONS_API_VERSION and sub_api with SOL_FLOW_SINGLE_OPTIONS_API_VERSION, or use SOL_FLOW_SINGLE_OPTIONS_DEFAULTS() to help you.

Field Documentation

struct sol_flow_node_options sol_flow_single_options::base

base guarantees sol_flow_node_options compatibility.

its sub_api must be set to SOL_FLOW_SINGLE_OPTIONS_API_VERSION.

const uint16_t* sol_flow_single_options::connected_ports_in

indexes of input ports that should be connected.

If non-NULL, must be an array terminated with UINT16_MAX. See SOL_FLOW_SINGLE_CONNECTIONS().

Note
some nodes will only process data from connected input ports, such as boolean/and will wait all connected ports before processing and sending output packets.
const uint16_t* sol_flow_single_options::connected_ports_out

indexes of output ports that should be connected.

If non-NULL, must be an array terminated with UINT16_MAX. See SOL_FLOW_SINGLE_CONNECTIONS().

Note
some node types only produce packets to ports that are connected, then make sure the port index is specified so you get the packets in process(). Then it is mandatory to connect to ports one wants to receive packets, but this is not checked due performance reasons.
const struct sol_flow_node_options* sol_flow_single_options::options

options to give to the actual base type.

If thie single node type wraps SOL_FLOW_NODE_TYPE_CONSOLE, then the options member should be of that sub_api and will be passed to SOL_FLOW_NODE_TYPE_CONSOLE->open().

void(* sol_flow_single_options::process)(void *user_data, struct sol_flow_node *node, uint16_t port, const struct sol_flow_packet *packet)

callback to deliver outgoing packets.

If non-NULL, this callback is used to deliver packets produced by the base node, with the first parameter user_data being the sibling member of the same name, node being the wrapper single node (not the actual instance to avoid miscommunications), port is the index of producing output port and packet is the produced packet to be delivered, it will be automatically deleted after this function returns, so don't keep a reference to it.

If NULL, the packet is dropped.

Note
some node types only produce packets to ports that are connected, then make sure the port index is specified in the connected_ports_out.
const void* sol_flow_single_options::user_data

user data to give to callback process().


The documentation for this struct was generated from the following file: