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 Structures | Macros | Typedefs | Functions | Variables
sol-flow-packet.h File Reference

These routines are used for Soletta flow packets manipulation. More...

#include <stdbool.h>
#include <stddef.h>
#include <time.h>
#include "sol-common-buildopts.h"
#include "sol-str-slice.h"
#include "sol-types.h"

Go to the source code of this file.

Data Structures

struct  sol_flow_packet_type
 A packet type defines what's the content of a packet and how it's stored and retrieved. More...
 

Macros

#define SOL_FLOW_PACKET_TYPE_API_VERSION   (1)
 

Typedefs

typedef struct sol_flow_packet sol_flow_packet
 A packet is a generic container for different kinds (types) of contents. More...
 
typedef struct sol_flow_packet_type sol_flow_packet_type
 A packet type defines what's the content of a packet and how it's stored and retrieved. More...
 

Functions

const char * sol_flow_get_packet_type_name (const struct sol_str_slice type)
 Returns the packet type variable as string. More...
 
void sol_flow_packet_del (struct sol_flow_packet *packet)
 Deletes a packet. More...
 
struct sol_flow_packetsol_flow_packet_dup (const struct sol_flow_packet *packet)
 Duplicates a packet. More...
 
int sol_flow_packet_get (const struct sol_flow_packet *packet, void *output)
 Retrieves the packet's content. More...
 
int sol_flow_packet_get_blob (const struct sol_flow_packet *packet, struct sol_blob **value)
 Retrieves the content of a Blob packet. More...
 
int sol_flow_packet_get_bool (const struct sol_flow_packet *packet, bool *boolean)
 Retrieves the content of a Boolean packet. More...
 
int sol_flow_packet_get_byte (const struct sol_flow_packet *packet, unsigned char *byte)
 Retrieves the content of a Byte packet. More...
 
int sol_flow_packet_get_composed_members (const struct sol_flow_packet *packet, struct sol_flow_packet ***children, uint16_t *len)
 Retrieves the list of packets contained in the composed packet. More...
 
int sol_flow_packet_get_composed_members_packet_types (const struct sol_flow_packet_type *type, const struct sol_flow_packet_type ***children, uint16_t *len)
 Retrieves the list of packet types that composes type. More...
 
int sol_flow_packet_get_direction_vector (const struct sol_flow_packet *packet, struct sol_direction_vector *direction_vector)
 Retrieves the content of a Direction Vector packet. More...
 
int sol_flow_packet_get_direction_vector_components (const struct sol_flow_packet *packet, double *x, double *y, double *z)
 Retrieves the direction components contained in a Direction Vector packet. More...
 
int sol_flow_packet_get_drange (const struct sol_flow_packet *packet, struct sol_drange *drange)
 Retrieves the content of an Drange packet. More...
 
int sol_flow_packet_get_drange_value (const struct sol_flow_packet *packet, double *value)
 Retrieves the Drange value of an Drange packet. More...
 
int sol_flow_packet_get_error (const struct sol_flow_packet *packet, int *code, const char **msg)
 Retrieves the content of an Error packet. More...
 
int sol_flow_packet_get_http_response (const struct sol_flow_packet *packet, int *response_code, const char **url, const char **content_type, const struct sol_blob **content, struct sol_vector *cookies, struct sol_vector *headers)
 Retrieves the content of a Timestamp packet. More...
 
int sol_flow_packet_get_irange (const struct sol_flow_packet *packet, struct sol_irange *irange)
 Retrieves the content of an Irange packet. More...
 
int sol_flow_packet_get_irange_value (const struct sol_flow_packet *packet, int32_t *value)
 Retrieves the Irange value of an Irange packet. More...
 
int sol_flow_packet_get_json_array (const struct sol_flow_packet *packet, struct sol_blob **value)
 Retrieves the content of a JSON Array packet. More...
 
int sol_flow_packet_get_json_object (const struct sol_flow_packet *packet, struct sol_blob **value)
 Retrieves the content of a JSON Object packet. More...
 
int sol_flow_packet_get_location (const struct sol_flow_packet *packet, struct sol_location *location)
 Retrieves the content of a Location packet. More...
 
int sol_flow_packet_get_location_components (const struct sol_flow_packet *packet, double *lat, double *lon, double *alt)
 Retrieves the location components contained in a Location packet. More...
 
int sol_flow_packet_get_rgb (const struct sol_flow_packet *packet, struct sol_rgb *rgb)
 Retrieves the content of a RGB packet. More...
 
int sol_flow_packet_get_rgb_components (const struct sol_flow_packet *packet, uint32_t *red, uint32_t *green, uint32_t *blue)
 Retrieves the RGB components contained in a RGB packet. More...
 
int sol_flow_packet_get_string (const struct sol_flow_packet *packet, const char **value)
 Retrieves the content of a String packet. More...
 
int sol_flow_packet_get_timestamp (const struct sol_flow_packet *packet, struct timespec *timestamp)
 Retrieves the content of a Timestamp packet. More...
 
const struct sol_flow_packet_typesol_flow_packet_get_type (const struct sol_flow_packet *packet)
 Retrieves the packet's type. More...
 
bool sol_flow_packet_is_composed_type (const struct sol_flow_packet_type *type)
 Checks if a given packet type is a composed packet type. More...
 
struct sol_flow_packetsol_flow_packet_new (const struct sol_flow_packet_type *type, const void *value)
 Creates a packet. More...
 
struct sol_flow_packetsol_flow_packet_new_blob (const struct sol_blob *value)
 Creates a new packet of type Blob. More...
 
struct sol_flow_packetsol_flow_packet_new_bool (bool boolean)
 Creates a new packet of type Boolean. More...
 
struct sol_flow_packetsol_flow_packet_new_byte (unsigned char byte)
 Creates a new packet of type Byte. More...
 
struct sol_flow_packetsol_flow_packet_new_direction_vector (const struct sol_direction_vector *direction_vector)
 Creates a new packet of type Direction Vector. More...
 
struct sol_flow_packetsol_flow_packet_new_direction_vector_components (double x, double y, double z)
 Creates a new packet of type Direction Vector from the given x, y and z components. More...
 
struct sol_flow_packetsol_flow_packet_new_drange (const struct sol_drange *drange)
 Creates a new packet of type Drange. More...
 
struct sol_flow_packetsol_flow_packet_new_drange_value (double value)
 Creates a new packet of type Drange with initial value value and default spec. More...
 
struct sol_flow_packetsol_flow_packet_new_empty (void)
 Creates a new packet of type Empty. More...
 
struct sol_flow_packetsol_flow_packet_new_error (int code, const char *msg)
 Creates a new packet of type Error. More...
 
struct sol_flow_packetsol_flow_packet_new_http_response (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)
 Creates a new packet of type HTTP Response. More...
 
struct sol_flow_packetsol_flow_packet_new_irange (const struct sol_irange *irange)
 Creates a new packet of type Irange. More...
 
struct sol_flow_packetsol_flow_packet_new_irange_value (int32_t value)
 Creates a new packet of type Irange with initial value value and default spec. More...
 
struct sol_flow_packetsol_flow_packet_new_json_array (const struct sol_blob *value)
 Creates a new packet of type JSON Array. More...
 
struct sol_flow_packetsol_flow_packet_new_json_object (const struct sol_blob *value)
 Creates a new packet of type JSON Object. More...
 
struct sol_flow_packetsol_flow_packet_new_location (const struct sol_location *location)
 Creates a new packet of type Location. More...
 
struct sol_flow_packetsol_flow_packet_new_location_components (double lat, double lon, double alt)
 Creates a new packet of type Location from the given lat, lon, alt components. More...
 
struct sol_flow_packetsol_flow_packet_new_rgb (const struct sol_rgb *rgb)
 Creates a new packet of type RGB. More...
 
struct sol_flow_packetsol_flow_packet_new_rgb_components (uint32_t red, uint32_t green, uint32_t blue)
 Creates a new packet of type RGB from the given red, green and blue components. More...
 
struct sol_flow_packetsol_flow_packet_new_string (const char *value)
 Creates a new packet of type String. More...
 
struct sol_flow_packetsol_flow_packet_new_string_slice (struct sol_str_slice slice)
 Creates a new packet of type String from string slice slice. More...
 
struct sol_flow_packetsol_flow_packet_new_string_take (char *value)
 Similar to sol_flow_packet_new_string() but takes ownership of value to use as the packet content. More...
 
struct sol_flow_packetsol_flow_packet_new_timestamp (const struct timespec *timestamp)
 Creates a new packet of type Timestamp. More...
 
const struct sol_flow_packet_typesol_flow_packet_type_composed_new (const struct sol_flow_packet_type **types)
 Creates a new packet type that is composed by the packets types in types. More...
 
const struct sol_flow_packet_typesol_flow_packet_type_from_string (const struct sol_str_slice type)
 Returns the packet type from string. More...
 

Variables

const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_ANY
 Type of the Any packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_BLOB
 Type of the Blob packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_BOOL
 Type of the Boolean packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_BYTE
 Type of the Byte packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_DIRECTION_VECTOR
 Type of the Direction Vector packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_DRANGE
 Type of the Drange packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_EMPTY
 Type of the Empty packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_ERROR
 Type of the Error packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_HTTP_RESPONSE
 Type of the Http Response packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_IRANGE
 Type of the Irange packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_JSON_ARRAY
 Type of the JSON Array packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_JSON_OBJECT
 Type of the JSON Object packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_LOCATION
 Type of the Location packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_RGB
 Type of the RGB packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_STRING
 Type of the String packet. More...
 
const struct sol_flow_packet_typeSOL_FLOW_PACKET_TYPE_TIMESTAMP
 Type of the Timestamp packet. More...
 

Detailed Description

These routines are used for Soletta flow packets manipulation.

Macro Definition Documentation

#define SOL_FLOW_PACKET_TYPE_API_VERSION   (1)