25 #include "sol-common-buildopts.h"
61 #ifndef SOL_NO_API_VERSION
62 #define SOL_FLOW_PACKET_TYPE_API_VERSION (1)
struct sol_flow_packet * sol_flow_packet_new_byte(unsigned char byte)
Creates a new packet of type Byte.
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.
struct sol_flow_packet * sol_flow_packet_new_rgb(const struct sol_rgb *rgb)
Creates a new packet of type RGB.
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.
struct sol_flow_packet * sol_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.
struct sol_flow_packet * sol_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.
int sol_flow_packet_get_error(const struct sol_flow_packet *packet, int *code, const char **msg)
Retrieves the content of an Error packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_ANY
Type of the Any packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_HTTP_RESPONSE
Type of the Http Response packet.
struct sol_flow_packet * sol_flow_packet_new_irange_value(int32_t value)
Creates a new packet of type Irange with initial value value and default spec.
const char * name
Type's name.
Definition: sol-flow-packet.h:66
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_BOOL
Type of the Boolean packet.
struct sol_flow_packet * sol_flow_packet_new_drange_value(double value)
Creates a new packet of type Drange with initial value value and default spec.
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.
int sol_flow_packet_get_rgb(const struct sol_flow_packet *packet, struct sol_rgb *rgb)
Retrieves the content of a RGB packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_DIRECTION_VECTOR
Type of the Direction Vector packet.
struct sol_flow_packet * sol_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.
These routines are used for Soletta types' manipulation.
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.
struct sol_flow_packet * sol_flow_packet_new_json_array(const struct sol_blob *value)
Creates a new packet of type JSON Array.
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.
void sol_flow_packet_del(struct sol_flow_packet *packet)
Deletes a packet.
struct sol_flow_packet * sol_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.
struct sol_flow_packet * sol_flow_packet_new_bool(bool boolean)
Creates a new packet of type Boolean.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_ERROR
Type of the Error packet.
Data type describing a Double range.
Definition: sol-types.h:187
int sol_flow_packet_get_bool(const struct sol_flow_packet *packet, bool *boolean)
Retrieves the content of a Boolean packet.
struct sol_flow_packet * sol_flow_packet_new_drange(const struct sol_drange *drange)
Creates a new packet of type Drange.
int sol_flow_packet_get_timestamp(const struct sol_flow_packet *packet, struct timespec *timestamp)
Retrieves the content of a Timestamp packet.
int sol_flow_packet_get_location(const struct sol_flow_packet *packet, struct sol_location *location)
Retrieves the content of a Location packet.
struct sol_flow_packet * sol_flow_packet_new_string_slice(struct sol_str_slice slice)
Creates a new packet of type String from string slice slice.
static struct sol_buffer value
Definition: server.c:42
struct sol_flow_packet sol_flow_packet
A packet is a generic container for different kinds (types) of contents.
Definition: sol-flow-packet.h:54
static struct sol_blob lat
Definition: lwm2m-server.c:61
String slice type.
Definition: sol-str-slice.h:84
Data type to describe a direction vector.
Definition: sol-types.h:125
int sol_flow_packet_get_string(const struct sol_flow_packet *packet, const char **value)
Retrieves the content of a String packet.
int sol_flow_packet_get_irange(const struct sol_flow_packet *packet, struct sol_irange *irange)
Retrieves the content of an Irange packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_TIMESTAMP
Type of the Timestamp packet.
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.
Data type describing Integer ranges.
Definition: sol-types.h:327
Data type to describe a location.
Definition: sol-types.h:146
const struct sol_flow_packet_type * sol_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.
struct sol_flow_packet * sol_flow_packet_new_blob(const struct sol_blob *value)
Creates a new packet of type Blob.
const char * sol_flow_get_packet_type_name(const struct sol_str_slice type)
Returns the packet type variable as string.
Data type to describe a RGB color.
Definition: sol-types.h:155
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_JSON_ARRAY
Type of the JSON Array packet.
struct sol_flow_packet * sol_flow_packet_new_empty(void)
Creates a new packet of type Empty.
int(* init)(const struct sol_flow_packet_type *packet_type, void *mem, const void *input)
Initializes a packet instance of this type.
Definition: sol-flow-packet.h:77
struct sol_flow_packet * sol_flow_packet_new_error(int code, const char *msg)
Creates a new packet of type Error.
Data type describing the default blob implementation.
Definition: sol-types.h:468
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_DRANGE
Type of the Drange packet.
struct sol_flow_packet * sol_flow_packet_dup(const struct sol_flow_packet *packet)
Duplicates a packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_BYTE
Type of the Byte packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_STRING
Type of the String packet.
struct sol_flow_packet * sol_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...
int sol_flow_packet_get(const struct sol_flow_packet *packet, void *output)
Retrieves the packet's content.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_IRANGE
Type of the Irange packet.
uint16_t api_version
API version number.
Definition: sol-flow-packet.h:63
struct sol_flow_packet * sol_flow_packet_new_timestamp(const struct timespec *timestamp)
Creates a new packet of type Timestamp.
int sol_flow_packet_get_drange(const struct sol_flow_packet *packet, struct sol_drange *drange)
Retrieves the content of an Drange packet.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_RGB
Type of the RGB packet.
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.
int sol_flow_packet_get_drange_value(const struct sol_flow_packet *packet, double *value)
Retrieves the Drange value of an Drange packet.
struct sol_flow_packet * sol_flow_packet_new_json_object(const struct sol_blob *value)
Creates a new packet of type JSON Object.
void(* dispose)(const struct sol_flow_packet_type *packet_type, void *mem)
Disposes a packet instance of this type.
Definition: sol-flow-packet.h:95
struct sol_flow_packet * sol_flow_packet_new_location(const struct sol_location *location)
Creates a new packet of type Location.
These are routines that Soletta provides for its string slice implementation.
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.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_BLOB
Type of the Blob packet.
int sol_flow_packet_get_byte(const struct sol_flow_packet *packet, unsigned char *byte)
Retrieves the content of a Byte packet.
struct sol_flow_packet * sol_flow_packet_new_direction_vector(const struct sol_direction_vector *direction_vector)
Creates a new packet of type Direction Vector.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_EMPTY
Type of the Empty packet.
int sol_flow_packet_get_irange_value(const struct sol_flow_packet *packet, int32_t *value)
Retrieves the Irange value of an Irange packet.
struct sol_flow_packet * sol_flow_packet_new_string(const char *value)
Creates a new packet of type String.
int sol_flow_packet_get_blob(const struct sol_flow_packet *packet, struct sol_blob **value)
Retrieves the content of a Blob packet.
const struct sol_flow_packet_type * sol_flow_packet_get_type(const struct sol_flow_packet *packet)
Retrieves the packet's type.
struct sol_flow_packet * sol_flow_packet_new(const struct sol_flow_packet_type *type, const void *value)
Creates a packet.
Soletta vector is an array that grows dynamically.
Definition: sol-vector.h:58
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.
uint16_t data_size
Data's size of a given packet type.
Definition: sol-flow-packet.h:65
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_JSON_OBJECT
Type of the JSON Object packet.
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.
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.
A packet type defines what's the content of a packet and how it's stored and retrieved.
Definition: sol-flow-packet.h:60
struct sol_flow_packet * sol_flow_packet_new_irange(const struct sol_irange *irange)
Creates a new packet of type Irange.
const struct sol_flow_packet_type * sol_flow_packet_type_from_string(const struct sol_str_slice type)
Returns the packet type from string.
const struct sol_flow_packet_type * SOL_FLOW_PACKET_TYPE_LOCATION
Type of the Location packet.