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
Functions | Variables
lowlevel.c File Reference

Example of soletta's flow in C using low-level API. More...

#include <stdlib.h>
#include "sol-macros.h"
#include "soletta.h"
#include "sol-flow-static.h"
#include "custom-node-types-gen.h"
#include "sol-flow/console.h"

Functions

static void shutdown (void)
 
 SOL_MAIN_DEFAULT (startup, shutdown)
 
static void startup (void)
 

Variables

static const struct
sol_flow_static_conn_spec 
conns []
 
static struct sol_flow_nodeflow
 
static struct
sol_flow_static_node_spec 
nodes []
 
static const struct
sol_flow_node_type_custom_node_types_reader_options 
reader_opts
 
static const struct
sol_flow_node_type_custom_node_types_writer_options 
writer_opts
 

Detailed Description

Example of soletta's flow in C using low-level API.

It will manipulate the nodes and connections by indexes in space-efficient lookup matrices.

It's not as nice to use, matrices are looked up in place and thus must be in correct ascending order.

This is the most efficient way to use soletta, but it's not user friendly. To solve this we recommend one to write FBP files and use da-fbp-generator to create the efficient lowlevel flow of it.

See highlevel.c on how to use the lowlevel API that does not rely on node type descriptions.

Function Documentation

static void shutdown ( void  )
static

References flow, and sol_flow_node_del().

SOL_MAIN_DEFAULT ( startup  ,
shutdown   
)
static void startup ( void  )
static

Variable Documentation

const struct sol_flow_static_conn_spec conns[]
static
Initial value:
= {
{ 0 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_READER__OUT__OUT,
1 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_LOGIC__IN__IN },
{ 0 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_READER__OUT__OUT,
3 , SOL_FLOW_NODE_TYPE_CONSOLE__IN__IN },
{ 1 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_LOGIC__OUT__OUT,
2 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_WRITER__IN__IN },
{ 1 , SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_LOGIC__OUT__OUT,
3 , SOL_FLOW_NODE_TYPE_CONSOLE__IN__IN },
}
#define SOL_FLOW_STATIC_CONN_SPEC_GUARD
Guard element of the connections spec array.
Definition: sol-flow-static.h:86
Examples:
/src/samples/flow/c-api/lowlevel.c.
struct sol_flow_node* flow
static

Referenced by shutdown(), and startup().

struct sol_flow_static_node_spec nodes[]
static
Initial value:
= {
[0] = { NULL ,
"reader", &reader_opts.base },
[1] = { NULL ,
"logic", NULL },
[2] = { NULL ,
"writer", &writer_opts.base },
[3] = { NULL ,
"console", NULL },
}
static const struct sol_flow_node_type_custom_node_types_reader_options reader_opts
Definition: lowlevel.c:48
#define SOL_FLOW_STATIC_NODE_SPEC_GUARD
Guard element of the nodes spec array.
Definition: sol-flow-static.h:81
static const struct sol_flow_node_type_custom_node_types_writer_options writer_opts
Definition: lowlevel.c:52
Examples:
/src/samples/flow/c-api/lowlevel.c.
const struct sol_flow_node_type_custom_node_types_reader_options reader_opts
static
Initial value:
=
SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_READER_OPTIONS_DEFAULTS(
.intopt = 1
)
Examples:
/src/samples/flow/c-api/lowlevel.c.
const struct sol_flow_node_type_custom_node_types_writer_options writer_opts
static
Initial value:
=
SOL_FLOW_NODE_TYPE_CUSTOM_NODE_TYPES_WRITER_OPTIONS_DEFAULTS(
.prefix = "writer prefix from options"
)
Examples:
/src/samples/flow/c-api/lowlevel.c.