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_packet_type Struct Reference

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

#include <sol-flow-packet.h>

Data Fields

uint16_t api_version
 API version number. More...
 
uint16_t data_size
 Data's size of a given packet type. More...
 
void(* dispose )(const struct sol_flow_packet_type *packet_type, void *mem)
 Disposes a packet instance of this type. More...
 
int(* get )(const struct sol_flow_packet_type *packet_type, const void *mem, void *output)
 Retrieves the content from a packet of this type. More...
 
struct sol_flow_packet *(* get_constant )(const struct sol_flow_packet_type *packet_type, const void *value)
 Internal. More...
 
int(* init )(const struct sol_flow_packet_type *packet_type, void *mem, const void *input)
 Initializes a packet instance of this type. More...
 
const char * name
 Type's name. More...
 

Detailed Description

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

Field Documentation

uint16_t sol_flow_packet_type::api_version

API version number.

uint16_t sol_flow_packet_type::data_size

Data's size of a given packet type.

void(* sol_flow_packet_type::dispose)(const struct sol_flow_packet_type *packet_type, void *mem)

Disposes a packet instance of this type.

Parameters
typeThe packet's type
memPacket's data to be disposed
int(* sol_flow_packet_type::get)(const struct sol_flow_packet_type *packet_type, const void *mem, void *output)

Retrieves the content from a packet of this type.

Parameters
typeThe packet's type
memPacket's data memory (the content)
outputWhere to store a copy the packet's content
Returns
0 on success, error code (always negative) otherwise
struct sol_flow_packet*(* sol_flow_packet_type::get_constant)(const struct sol_flow_packet_type *packet_type, const void *value)

Internal.

Used for types that have a set of constant values.

This way no allocation is needed.

Parameters
typeThe packet's type
valueConstant initial value
int(* sol_flow_packet_type::init)(const struct sol_flow_packet_type *packet_type, void *mem, const void *input)

Initializes a packet instance of this type.

Parameters
typeThe packet's type
memPacket's data memory (the content)
inputInitial data for the packet's content
Returns
0 on success, error code (always negative) otherwise
const char* sol_flow_packet_type::name

Type's name.


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