|
Soletta™ Framework
|
The flow system consists of a series of connected nodes that send packets to each other via ports. More...
Modules | |
| Flow Builder | |
| Flow-builder is a helper component that creates nodes and connections specs with a friendly API. | |
| Flow Inspector | |
| Soletta flow's runtime inspector. | |
| Flow Packet | |
| Flow packet is the fundamental data structure used to pass information between nodes in a flow. | |
| Flow Parser | |
| The Flow Parser is used to transform a textual description (either FBP or other metatypes) into node types that can be used in a flow. | |
| Flow's Simple C Type | |
| Helper to create a flow node type from a simple C function. | |
| Resolver | |
| A Resolver matches type names to an actual node_type and possibly a companion options. | |
| Single Flow | |
| Single flow is a parent node that creates a single children that works stand alone. | |
| Static Flow | |
| Static flow is a parent node that creates its children nodes and routes packets between them. | |
Data Structures | |
| struct | sol_flow_node_container_type |
| Structure of Container Node. More... | |
| struct | sol_flow_node_named_options |
| Named options is an intermediate structure to handle Node Options parsing. More... | |
| struct | sol_flow_node_named_options_member |
| Structure of a Options Member. More... | |
| struct | sol_flow_node_options |
| Node options are a set of attributes defined by the Node Type that can change the behavior of a Node. More... | |
| struct | sol_flow_node_type |
| The node type describes the capabilities and operations of a node. More... | |
| struct | sol_flow_port_type_in |
| Node's Input port structure. More... | |
| struct | sol_flow_port_type_out |
| Node's Output port structure. More... | |
Macros | |
| #define | sol_flow_get_node_type(_mod, _type, _var) ({ (*(_var)) = &_type; 0; }) |
| Gets the specified node type, loading the necessary module if required. More... | |
| #define | sol_flow_get_packet_type(_mod, _type, _var) ({ (*(_var)) = _type; 0; }) |
| Gets the specified packet type, loading the necessary module if required. More... | |
| #define | SOL_FLOW_NODE_PORT_ERROR_NAME ("ERROR") |
| Error port identifier. More... | |
Typedefs | |
| typedef struct sol_flow_node | sol_flow_node |
| A node is an entity that has input/output ports. More... | |
| typedef struct sol_flow_node_container_type | sol_flow_node_container_type |
| Structure of Container Node. More... | |
| typedef struct sol_flow_node_named_options | sol_flow_node_named_options |
| Named options is an intermediate structure to handle Node Options parsing. More... | |
| typedef struct sol_flow_node_named_options_member | sol_flow_node_named_options_member |
| Structure of a Options Member. More... | |
| typedef struct sol_flow_node_options | sol_flow_node_options |
| Node options are a set of attributes defined by the Node Type that can change the behavior of a Node. More... | |
| typedef struct sol_flow_node_type | sol_flow_node_type |
| The node type describes the capabilities and operations of a node. More... | |
| typedef struct sol_flow_port_type_in | sol_flow_port_type_in |
| Node's Input port structure. More... | |
| typedef struct sol_flow_port_type_out | sol_flow_port_type_out |
| Node's Output port structure. More... | |
Enumerations | |
| enum | sol_flow_node_options_member_type { SOL_FLOW_NODE_OPTIONS_MEMBER_UNKNOWN, SOL_FLOW_NODE_OPTIONS_MEMBER_BOOL, SOL_FLOW_NODE_OPTIONS_MEMBER_BYTE, SOL_FLOW_NODE_OPTIONS_MEMBER_DIRECTION_VECTOR, SOL_FLOW_NODE_OPTIONS_MEMBER_DRANGE_SPEC, SOL_FLOW_NODE_OPTIONS_MEMBER_FLOAT, SOL_FLOW_NODE_OPTIONS_MEMBER_INT, SOL_FLOW_NODE_OPTIONS_MEMBER_IRANGE_SPEC, SOL_FLOW_NODE_OPTIONS_MEMBER_RGB, SOL_FLOW_NODE_OPTIONS_MEMBER_STRING } |
| Possible types for option attributes (or members). More... | |
| enum | sol_flow_node_type_flags { SOL_FLOW_NODE_TYPE_FLAGS_CONTAINER = (1 << 0) } |
| Flags used to set some sol_flow_node_type characteristics. More... | |
Functions | |
| void | sol_flow_node_del (struct sol_flow_node *node) |
| Deletes a node. More... | |
| const char * | sol_flow_node_get_id (const struct sol_flow_node *node) |
| Retrieves the node ID string. More... | |
| const struct sol_flow_node * | sol_flow_node_get_parent (const struct sol_flow_node *node) |
| Gets the node's parent. More... | |
| void * | sol_flow_node_get_private_data (const struct sol_flow_node *node) |
| Retrieves a node private data. More... | |
| const struct sol_flow_node_type * | sol_flow_node_get_type (const struct sol_flow_node *node) |
| Get a node's type. More... | |
| void | sol_flow_node_named_options_fini (struct sol_flow_node_named_options *named_opts) |
| Finalize named options. More... | |
| int | sol_flow_node_named_options_init_from_strv (struct sol_flow_node_named_options *named_opts, const struct sol_flow_node_type *type, const char *const *strv) |
| Initializes a Named options structure from a options string. More... | |
| struct sol_flow_node * | sol_flow_node_new (struct sol_flow_node *parent, const char *id, const struct sol_flow_node_type *type, const struct sol_flow_node_options *options) |
| Creates a new node. More... | |
| void | sol_flow_node_options_del (const struct sol_flow_node_type *type, struct sol_flow_node_options *options) |
| Delete an options handle. More... | |
| enum sol_flow_node_options_member_type | sol_flow_node_options_member_type_from_string (const char *data_type) |
Returns the option member type which name is data_type. More... | |
| const char * | sol_flow_node_options_member_type_to_str (enum sol_flow_node_options_member_type type) |
| Returns a string for the name of a given option member type. More... | |
| int | sol_flow_node_options_new (const struct sol_flow_node_type *type, const struct sol_flow_node_named_options *named_opts, struct sol_flow_node_options **out_opts) |
| Creates a new Node Options. More... | |
| void | sol_flow_node_options_strv_del (char **opts_strv) |
| Delete a key-value options array. More... | |
| void | sol_flow_node_type_del (struct sol_flow_node_type *type) |
| Delete a node type. More... | |
| const struct sol_flow_port_type_in * | sol_flow_node_type_get_port_in (const struct sol_flow_node_type *type, uint16_t port) |
| Get a node type's input port definition struct, given a port index. More... | |
| const struct sol_flow_port_type_out * | sol_flow_node_type_get_port_out (const struct sol_flow_node_type *type, uint16_t port) |
| Get a node type's output port definition struct, given a port index. More... | |
| int | sol_flow_send_blob_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_blob *value) |
| Convenience function to create and send a Blob packet. More... | |
| int | sol_flow_send_bool_packet (struct sol_flow_node *src, uint16_t src_port, unsigned char value) |
| Convenience function to create and send a Boolean packet. More... | |
| int | sol_flow_send_byte_packet (struct sol_flow_node *src, uint16_t src_port, unsigned char value) |
| Convenience function to create and send a Byte packet. More... | |
| int | sol_flow_send_composed_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_flow_packet_type *composed_type, struct sol_flow_packet **children) |
| Convenience function to create and send a Composed packet. More... | |
| int | sol_flow_send_direction_vector_components_packet (struct sol_flow_node *src, uint16_t src_port, double x, double y, double z) |
| Similar to sol_flow_send_direction_vector_packet(), but takes the vector components as arguments. More... | |
| int | sol_flow_send_direction_vector_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_direction_vector *value) |
| Convenience function to create and send a Direction Vector packet. More... | |
| int | sol_flow_send_drange_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_drange *value) |
| Convenience function to create and send a Drange packet. More... | |
| int | sol_flow_send_drange_value_packet (struct sol_flow_node *src, uint16_t src_port, double value) |
Convenience function to create and send a Drange packet of value value and default spec. More... | |
| int | sol_flow_send_empty_packet (struct sol_flow_node *src, uint16_t src_port) |
| Convenience function to create and send an Empty packet. More... | |
| int | sol_flow_send_error_packet (struct sol_flow_node *src, int code, const char *msg_fmt,...) SOL_ATTR_PRINTF(3 |
| Convenience function to create and send an Error packet. More... | |
| int int | sol_flow_send_error_packet_errno (struct sol_flow_node *src, int code) |
Similar to sol_flow_send_error_packet, but uses a default error message based on code. More... | |
| int | sol_flow_send_error_packet_str (struct sol_flow_node *src, int code, const char *str) |
| Similar to sol_flow_send_error_packet, but the error message is ready to be used. More... | |
| int | sol_flow_send_http_response_packet (struct sol_flow_node *src, uint16_t src_port, int response_code, const char *url, const char *content_type, const struct sol_blob *content, const struct sol_vector *cookies, const struct sol_vector *headers) |
| Convenience function to create and send a HTTP Response packet. More... | |
| int | sol_flow_send_irange_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_irange *value) |
| Convenience function to create and send an Irange packet. More... | |
| int | sol_flow_send_irange_value_packet (struct sol_flow_node *src, uint16_t src_port, int32_t value) |
Convenience function to create and send a Irange packet of value value and default spec. More... | |
| int | sol_flow_send_json_array_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_blob *value) |
| Convenience function to create and send a JSON Array packet. More... | |
| int | sol_flow_send_json_object_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_blob *value) |
| Convenience function to create and send a JSON Object packet. More... | |
| int | sol_flow_send_location_components_packet (struct sol_flow_node *src, uint16_t src_port, double lat, double lon, double alt) |
| Similar to sol_flow_send_location_packet(), but takes the location components as arguments. More... | |
| int | sol_flow_send_location_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_location *value) |
| Convenience function to create and send a Location packet. More... | |
| int | sol_flow_send_packet (struct sol_flow_node *src, uint16_t src_port, struct sol_flow_packet *packet) |
| Send a packet from a given node to one of its output ports. More... | |
| int | sol_flow_send_rgb_components_packet (struct sol_flow_node *src, uint16_t src_port, uint32_t red, uint32_t green, uint32_t blue) |
| Similar to sol_flow_send_rgb_packet(), but takes the RGB components as arguments. More... | |
| int | sol_flow_send_rgb_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_rgb *value) |
| Convenience function to create and send a RGB packet. More... | |
| int | sol_flow_send_string_packet (struct sol_flow_node *src, uint16_t src_port, const char *value) |
| Convenience function to create and send a String packet. More... | |
| int | sol_flow_send_string_slice_packet (struct sol_flow_node *src, uint16_t src_port, const struct sol_str_slice value) |
| Convenience function to create and send a String packet from a string slice. More... | |
| int | sol_flow_send_string_take_packet (struct sol_flow_node *src, uint16_t src_port, char *value) |
Convenience function to create and send a String packet but takes ownership of value to use as the packet content. More... | |
| int | sol_flow_send_timestamp_packet (struct sol_flow_node *src, uint16_t src_port, const struct timespec *value) |
| Convenience function to create and send a Timestamp packet. More... | |
The flow system consists of a series of connected nodes that send packets to each other via ports.
Each node may have multiple input/output ports. It is responsibility of the parent (see sol_flow_node_container_type) node to deliver the packets sent by its children nodes (one thing the "static flow" node, returned by sol_flow_static_new(), already does).
| #define sol_flow_get_node_type | ( | _mod, | |
| _type, | |||
| _var | |||
| ) | ({ (*(_var)) = &_type; 0; }) |
Gets the specified node type, loading the necessary module if required.
Checks if the node type _type is built-in, if not, it loads the module _mod and fetches the type's symbol there. The result is stored in _var.
| _mod | The name of the module to load if the symbol is not built-in. |
| _type | The node type's symbol. |
| _var | Variable where to store the type. |
Referenced by create_minutes(), create_seconds(), and startup().
| #define sol_flow_get_packet_type | ( | _mod, | |
| _type, | |||
| _var | |||
| ) | ({ (*(_var)) = _type; 0; }) |
Gets the specified packet type, loading the necessary module if required.
Checks if the node type _type is built-in, if not, it loads the module _mod and fetches the packet's symbol there. The result is stored in _var.
| _mod | The name of the module to load if the packet is not built-in. |
| _type | The packet type's symbol. |
| _var | Variable where to store the type. |
| #define SOL_FLOW_NODE_PORT_ERROR_NAME ("ERROR") |
Error port identifier.
A node is an entity that has input/output ports.
Its operations are described by a node type, so that the node can be seen as a class instance, being the node type the class.
Nodes receive packets in their input ports and can send packets to their output ports.
| typedef struct sol_flow_node_container_type sol_flow_node_container_type |
Structure of Container Node.
When a node type is a container (i.e. may act as parent of other nodes), it should provide extra operations. This is the case of the "static flow" node.
| typedef struct sol_flow_node_named_options sol_flow_node_named_options |
Named options is an intermediate structure to handle Node Options parsing.
Used to help the options parser to parse an options string.
Structure of a Options Member.
| typedef struct sol_flow_node_options sol_flow_node_options |
Node options are a set of attributes defined by the Node Type that can change the behavior of a Node.
| typedef struct sol_flow_node_type sol_flow_node_type |
The node type describes the capabilities and operations of a node.
So a node can be seen as a class instance, being the node type the class.
This description is usually defined as const static and shared by many different nodes.
| typedef struct sol_flow_port_type_in sol_flow_port_type_in |
Node's Input port structure.
| typedef struct sol_flow_port_type_out sol_flow_port_type_out |
Node's Output port structure.
Possible types for option attributes (or members).
Flags used to set some sol_flow_node_type characteristics.
| Enumerator | |
|---|---|
| SOL_FLOW_NODE_TYPE_FLAGS_CONTAINER |
Flag to set the node as Container (a "static flow" node is an example) |
| void sol_flow_node_del | ( | struct sol_flow_node * | node | ) |
Deletes a node.
The root node should be deleted in the sol_main_callbacks::shutdown function – it will take care of recursively deleting its children nodes.
| node | The node to be deleted |
Referenced by shutdown().
| const char* sol_flow_node_get_id | ( | const struct sol_flow_node * | node | ) |
Retrieves the node ID string.
As given to the node on sol_flow_node_new()
| node | The Node |
NULL otherwise. | const struct sol_flow_node* sol_flow_node_get_parent | ( | const struct sol_flow_node * | node | ) |
Gets the node's parent.
| node | The node to get the parent from |
NULL if node is the top/root node. | void* sol_flow_node_get_private_data | ( | const struct sol_flow_node * | node | ) |
Retrieves a node private data.
Private data is the data allocated by the system for each node, whose size is described by data_size attribute of the node's type.
| node | The Node |
Referenced by on_timeout(), and reader_on_timeout().
| const struct sol_flow_node_type* sol_flow_node_get_type | ( | const struct sol_flow_node * | node | ) |
Get a node's type.
| node | The node get the type from |
NULL, on errors Referenced by get_int32_packet_and_log().
| void sol_flow_node_named_options_fini | ( | struct sol_flow_node_named_options * | named_opts | ) |
Finalize named options.
| named_opts | Named options to be finalized |
Referenced by create_minutes(), create_seconds(), and show_resolved_type().
| int sol_flow_node_named_options_init_from_strv | ( | struct sol_flow_node_named_options * | named_opts, |
| const struct sol_flow_node_type * | type, | ||
| const char *const * | strv | ||
| ) |
Initializes a Named options structure from a options string.
| named_opts | Named Options to be initialized |
| type | The Node Type |
| strv | Options string used to initialize the Named Options |
0 on success, a negative error code on errors Referenced by create_minutes(), and create_seconds().
| struct sol_flow_node* sol_flow_node_new | ( | struct sol_flow_node * | parent, |
| const char * | id, | ||
| const struct sol_flow_node_type * | type, | ||
| const struct sol_flow_node_options * | options | ||
| ) |
Creates a new node.
Nodes should be created in the sol_main_callbacks::startup function, and at least the root one must be a "static flow" node. (
| parent | The parent node. Pass NULL if you're creating the root node of the flow. |
| id | A string to identify the node |
| type | The type of the node |
| options | Options to individually parametrize the type instance ( |
NULL Referenced by startup().
| void sol_flow_node_options_del | ( | const struct sol_flow_node_type * | type, |
| struct sol_flow_node_options * | options | ||
| ) |
Delete an options handle.
| type | The node type |
| options | The node options |
Referenced by create_minutes(), and create_seconds().
| enum sol_flow_node_options_member_type sol_flow_node_options_member_type_from_string | ( | const char * | data_type | ) |
Returns the option member type which name is data_type.
| data_type | Name of the option member type |
| const char* sol_flow_node_options_member_type_to_str | ( | enum sol_flow_node_options_member_type | type | ) |
Returns a string for the name of a given option member type.
| type | Type to be named |
NULL on errors | int sol_flow_node_options_new | ( | const struct sol_flow_node_type * | type, |
| const struct sol_flow_node_named_options * | named_opts, | ||
| struct sol_flow_node_options ** | out_opts | ||
| ) |
Creates a new Node Options.
| type | The Node Type |
| named_opts | Named Options to parse |
| out_opts | The final Node Options |
0 on success, a negative error code on errors Referenced by create_minutes(), and create_seconds().
| void sol_flow_node_options_strv_del | ( | char ** | opts_strv | ) |
Delete a key-value options array.
| opts_strv | Options array to be deleted |
| void sol_flow_node_type_del | ( | struct sol_flow_node_type * | type | ) |
Delete a node type.
It should be used only for types dynamically created and returned by functions like sol_flow_static_new_type().
| type | The node type to be deleted |
Referenced by shutdown().
| const struct sol_flow_port_type_in* sol_flow_node_type_get_port_in | ( | const struct sol_flow_node_type * | type, |
| uint16_t | port | ||
| ) |
Get a node type's input port definition struct, given a port index.
| type | The node type to get a port definition from |
| port | The port's index to retrieve |
NULL, on errors. | const struct sol_flow_port_type_out* sol_flow_node_type_get_port_out | ( | const struct sol_flow_node_type * | type, |
| uint16_t | port | ||
| ) |
Get a node type's output port definition struct, given a port index.
| type | The node type to get a port definition from |
| port | The port's index to retrieve |
NULL, on errors. | int sol_flow_send_blob_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_blob * | value | ||
| ) |
Convenience function to create and send a Blob packet.
Similar to sol_flow_send_packet(), but specific for Blob packets. It will create a new Blob packet and send it through src node at src_port port.
| src | The node that is to output the Blob packet |
| src_port | The port where the packet will be output |
| value | Blob packet content |
0 on success, a negative error code on errors. | int sol_flow_send_bool_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| unsigned char | value | ||
| ) |
Convenience function to create and send a Boolean packet.
Similar to sol_flow_send_packet(), but specific for Boolean packets. It will create a new Boolean packet and send it through src node at src_port port.
| src | The node that is to output the Boolean packet |
| src_port | The port where the packet will be output |
| value | Boolean packet content |
0 on success, a negative error code on errors. Referenced by isodd(), logic_process(), and on_minutes_packet().
| int sol_flow_send_byte_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| unsigned char | value | ||
| ) |
Convenience function to create and send a Byte packet.
Similar to sol_flow_send_packet(), but specific for Byte packets. It will create a new Byte packet and send it through src node at src_port port.
| src | The node that is to output the Byte packet |
| src_port | The port where the packet will be output |
| value | Byte packet content |
0 on success, a negative error code on errors. | int sol_flow_send_composed_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_flow_packet_type * | composed_type, | ||
| struct sol_flow_packet ** | children | ||
| ) |
Convenience function to create and send a Composed packet.
Similar to sol_flow_send_packet(), but specific for Composed packets. It will create a new Composed packet from the composed_type and children and send it through src node at src_port port.
| src | The node that is to output the Blob packet |
| src_port | The port where the packet will be output |
| composed_type | The composed packet type |
| children | List of children packets |
0 on success, a negative error code on errors. | int sol_flow_send_direction_vector_components_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Similar to sol_flow_send_direction_vector_packet(), but takes the vector components as arguments.
| src | The node that is to output the Direction Vector packet |
| src_port | The port where the packet will be output |
| x | X value |
| y | Y value |
| z | Z value |
0 on success, a negative error code on errors.| int sol_flow_send_direction_vector_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_direction_vector * | value | ||
| ) |
Convenience function to create and send a Direction Vector packet.
Similar to sol_flow_send_packet(), but specific for Direction Vector packets. It will create a new Direction Vector packet and send it through src node at src_port port.
| src | The node that is to output the Direction Vector packet |
| src_port | The port where the packet will be output |
| value | Direction Vector packet content |
0 on success, a negative error code on errors.| int sol_flow_send_drange_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_drange * | value | ||
| ) |
Convenience function to create and send a Drange packet.
Similar to sol_flow_send_packet(), but specific for Drange packets. It will create a new Drange packet and send it through src node at src_port port.
| src | The node that is to output the Drange packet |
| src_port | The port where the packet will be output |
| value | Drange packet content |
0 on success, a negative error code on errors.| int sol_flow_send_drange_value_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| double | value | ||
| ) |
Convenience function to create and send a Drange packet of value value and default spec.
Similar to sol_flow_send_drange_packet(), but creates a Drange struct from value and set the default spec to it.
| src | The node that is to output the Drange packet |
| src_port | The port where the packet will be output |
| value | Desired Drange value |
0 on success, a negative error code on errors.Referenced by logic_process().
| int sol_flow_send_empty_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port | ||
| ) |
Convenience function to create and send an Empty packet.
Similar to sol_flow_send_packet(), but specific for Empty packets. It will create a new Empty packet and send it through src node at src_port port.
| src | The node that is to output the Empty packet |
| src_port | The port where the packet will be output |
0 on success, a negative error code on errors. | int sol_flow_send_error_packet | ( | struct sol_flow_node * | src, |
| int | code, | ||
| const char * | msg_fmt, | ||
| ... | |||
| ) |
Convenience function to create and send an Error packet.
Similar to sol_flow_send_packet(), but specific for Error packets. It will create a new Error packet and send it through src node.
| src | The node that is to output the error packet |
| code | Error code |
| msg_fmt | A standard 'printf()' format string. Used to create the error message. |
| ... | Arguments to msg_fmt |
0 on success, a negative error code on errors. | int int sol_flow_send_error_packet_errno | ( | struct sol_flow_node * | src, |
| int | code | ||
| ) |
Similar to sol_flow_send_error_packet, but uses a default error message based on code.
| src | The node that is to output the error packet |
| code | Error code |
0 on success, a negative error code on errors. | int sol_flow_send_error_packet_str | ( | struct sol_flow_node * | src, |
| int | code, | ||
| const char * | str | ||
| ) |
Similar to sol_flow_send_error_packet, but the error message is ready to be used.
| src | The node that is to output the error packet |
| code | Error code |
| str | Error message |
0 on success, a negative error code on errors. | int sol_flow_send_http_response_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| int | response_code, | ||
| const char * | url, | ||
| const char * | content_type, | ||
| const struct sol_blob * | content, | ||
| const struct sol_vector * | cookies, | ||
| const struct sol_vector * | headers | ||
| ) |
Convenience function to create and send a HTTP Response packet.
Similar to sol_flow_send_packet(), but specific for HTTP Response packets. It will create a new HTTP Response packet and send it through src node at src_port port.
| src | The node that is to output the HTTP Response packet |
| src_port | The port where the packet will be output |
| response_code | The response code |
| url | Response URL |
| content_type | The response content type |
| content | The response content |
| cookies | Response cookies |
| headers | Response headers |
0 on success, a negative error code on errors. | int sol_flow_send_irange_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_irange * | value | ||
| ) |
Convenience function to create and send an Irange packet.
Similar to sol_flow_send_packet(), but specific for Irange packets. It will create a new Irange packet and send it through src node at src_port port.
| src | The node that is to output the Irange packet |
| src_port | The port where the packet will be output |
| value | Irange packet content |
0 on success, a negative error code on errors.| int sol_flow_send_irange_value_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| int32_t | value | ||
| ) |
Convenience function to create and send a Irange packet of value value and default spec.
Similar to sol_flow_send_irange_packet(), but creates a Irange struct from value and set the default spec to it.
| src | The node that is to output the Irange packet |
| src_port | The port where the packet will be output |
| value | Desired Irange value |
0 on success, a negative error code on errors.Referenced by reader_on_timeout(), and reader_open().
| int sol_flow_send_json_array_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_blob * | value | ||
| ) |
Convenience function to create and send a JSON Array packet.
Similar to sol_flow_send_packet(), but specific for JSON Array packets. It will create a new JSON Array packet and send it through src node at src_port port.
| src | The node that is to output the JSON Array packet |
| src_port | The port where the packet will be output |
| value | JSON Array packet content |
0 on success, a negative error code on errors. | int sol_flow_send_json_object_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_blob * | value | ||
| ) |
Convenience function to create and send a JSON Object packet.
Similar to sol_flow_send_packet(), but specific for JSON Object packets. It will create a new JSON Object packet and send it through src node at src_port port.
| src | The node that is to output the JSON Object packet |
| src_port | The port where the packet will be output |
| value | JSON Object packet content |
0 on success, a negative error code on errors. | int sol_flow_send_location_components_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| double | lat, | ||
| double | lon, | ||
| double | alt | ||
| ) |
Similar to sol_flow_send_location_packet(), but takes the location components as arguments.
| src | The node that is to output the Location packet |
| src_port | The port where the packet will be output |
| lat | Latitude value |
| lon | Longitude value |
| alt | Altitude value |
0 on success, a negative error code otherwise.| int sol_flow_send_location_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_location * | value | ||
| ) |
Convenience function to create and send a Location packet.
Similar to sol_flow_send_packet(), but specific for Location packets. It will create a new Location packet and send it through src node at src_port port.
| src | The node that is to output the Location packet |
| src_port | The port where the packet will be output |
| value | Location packet content |
0 on success, a negative error code on errors. | int sol_flow_send_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| struct sol_flow_packet * | packet | ||
| ) |
Send a packet from a given node to one of its output ports.
The parent node of src will take care of routing the packet to the appropriated input ports of connected nodes.
| src | The node that is to output a packet |
| src_port | The port where the packet will be output |
| packet | The packet to output |
0 on success, a negative error code on errors. | int sol_flow_send_rgb_components_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| uint32_t | red, | ||
| uint32_t | green, | ||
| uint32_t | blue | ||
| ) |
Similar to sol_flow_send_rgb_packet(), but takes the RGB components as arguments.
| src | The node that is to output the RGB packet |
| src_port | The port where the packet will be output |
| red | Red value |
| green | Green value |
| blue | Blue value |
0 on success, a negative error code on errors.| int sol_flow_send_rgb_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_rgb * | value | ||
| ) |
Convenience function to create and send a RGB packet.
Similar to sol_flow_send_packet(), but specific for RGB packets. It will create a new RGB packet and send it through src node at src_port port.
| src | The node that is to output the RGB packet |
| src_port | The port where the packet will be output |
| value | RGB packet content |
0 on success, a negative error code on errors.| int sol_flow_send_string_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const char * | value | ||
| ) |
Convenience function to create and send a String packet.
Similar to sol_flow_send_packet(), but specific for String packets. It will create a new String packet and send it through src node at src_port port.
| src | The node that is to output the String packet |
| src_port | The port where the packet will be output |
| value | String packet content |
0 on success, a negative error code on errors.Referenced by on_timeout().
| int sol_flow_send_string_slice_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct sol_str_slice | value | ||
| ) |
Convenience function to create and send a String packet from a string slice.
Similar to sol_flow_send_string_packet(), but takes a sol_str_slice instead of a C string.
| src | The node that is to output the String packet |
| src_port | The port where the packet will be output |
| value | String slice to create the packet content |
0 on success, a negative error code on errors.| int sol_flow_send_string_take_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| char * | value | ||
| ) |
Convenience function to create and send a String packet but takes ownership of value to use as the packet content.
Instead of copying the initial string to the packets content, takes ownership of value memory.
| src | The node that is to output the String packet |
| src_port | The port where the packet will be output |
| value | String packet content |
0 on success, a negative error code on errors.| int sol_flow_send_timestamp_packet | ( | struct sol_flow_node * | src, |
| uint16_t | src_port, | ||
| const struct timespec * | value | ||
| ) |
Convenience function to create and send a Timestamp packet.
Similar to sol_flow_send_packet(), but specific for Timestamp packets. It will create a new Timestamp packet and send it through src node at src_port port.
| src | The node that is to output the Timestamp packet |
| src_port | The port where the packet will be output |
| value | Timestamp packet content |
0 on success, a negative error code on errors.
1.8.6