Astarte device API for Zephyr 0.9.0
Astarte device SDK for Zephyr RTOS
Loading...
Searching...
No Matches

Definitions for Astarte base data types. More...

Data Structures

struct  astarte_data_t
 Base Astarte data type. More...
 

Functions

astarte_data_t astarte_data_from_binaryblob (const void *buf, size_t len)
 Initialize an astarte data from the input binaryblob.
 
astarte_data_t astarte_data_from_boolean (bool val)
 Initialize an astarte data from the input boolean.
 
astarte_data_t astarte_data_from_datetime (int64_t val)
 Initialize an astarte data from the input datetime.
 
astarte_data_t astarte_data_from_double (double val)
 Initialize an astarte data from the input double.
 
astarte_data_t astarte_data_from_integer (int32_t val)
 Initialize an astarte data from the input integer.
 
astarte_data_t astarte_data_from_longinteger (int64_t val)
 Initialize an astarte data from the input longinteger.
 
astarte_data_t astarte_data_from_string (const char *val)
 Initialize an astarte data from the input string.
 
astarte_data_t astarte_data_from_binaryblob_array (const void **blobs, size_t *sizes, size_t count)
 Initialize an astarte data from the input binaryblob array.
 
astarte_data_t astarte_data_from_boolean_array (const bool *buf, size_t len)
 Initialize an astarte data from the input boolean array.
 
astarte_data_t astarte_data_from_datetime_array (const int64_t *buf, size_t len)
 Initialize an astarte data from the input datetime array.
 
astarte_data_t astarte_data_from_double_array (const double *buf, size_t len)
 Initialize an astarte data from the input double array.
 
astarte_data_t astarte_data_from_integer_array (const int32_t *buf, size_t len)
 Initialize an astarte data from the input integer array.
 
astarte_data_t astarte_data_from_longinteger_array (const int64_t *buf, size_t len)
 Initialize an astarte data from the input longinteger array.
 
astarte_data_t astarte_data_from_string_array (const char **buf, size_t len)
 Initialize an astarte data from the input string array.
 
astarte_mapping_type_t astarte_data_get_type (astarte_data_t data)
 Get the type of Astarte data.
 
astarte_result_t astarte_data_to_binaryblob (astarte_data_t data, const void **buf, size_t *len)
 Convert Astarte data (of the binary blob type) to an array of binary blobs.
 
astarte_result_t astarte_data_to_boolean (astarte_data_t data, bool *val)
 Convert Astarte data (of the boolean type) to a bool.
 
astarte_result_t astarte_data_to_datetime (astarte_data_t data, int64_t *val)
 Convert Astarte data (of the datetime type) to an int64_t.
 
astarte_result_t astarte_data_to_double (astarte_data_t data, double *val)
 Convert Astarte data (of double type) to a double.
 
astarte_result_t astarte_data_to_integer (astarte_data_t data, int32_t *val)
 Convert Astarte data (of the integer type) to an int32_t.
 
astarte_result_t astarte_data_to_longinteger (astarte_data_t data, int64_t *val)
 Convert Astarte data (of the long integer type) to an int64_t.
 
astarte_result_t astarte_data_to_string (astarte_data_t data, const char **val)
 Convert Astarte data (of the string type) to a const char *.
 
astarte_result_t astarte_data_to_binaryblob_array (astarte_data_t data, const void ***blobs, size_t **sizes, size_t *count)
 Convert Astarte data (of binaryblob array type) to an array of binaryblob arrays.
 
astarte_result_t astarte_data_to_boolean_array (astarte_data_t data, const bool **buf, size_t *len)
 Convert Astarte data (of boolean array type) to a bool array.
 
astarte_result_t astarte_data_to_datetime_array (astarte_data_t data, const int64_t **buf, size_t *len)
 Convert Astarte data (of datetime array type) to an int64_t array.
 
astarte_result_t astarte_data_to_double_array (astarte_data_t data, const double **buf, size_t *len)
 Convert Astarte data (of double array type) to a double array.
 
astarte_result_t astarte_data_to_integer_array (astarte_data_t data, const int32_t **buf, size_t *len)
 Convert Astarte data (of integer array type) to an int32_t array.
 
astarte_result_t astarte_data_to_longinteger_array (astarte_data_t data, const int64_t **buf, size_t *len)
 Convert Astarte data (of longinteger array type) to an int64_t array.
 
astarte_result_t astarte_data_to_string_array (astarte_data_t data, const char ***buf, size_t *len)
 Convert Astarte data (of string type) to a const char* array.
 

Detailed Description

Definitions for Astarte base data types.

Function Documentation

◆ astarte_data_from_binaryblob()

astarte_data_t astarte_data_from_binaryblob ( const void * buf,
size_t len )

Initialize an astarte data from the input binaryblob.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the binaryblob input.

◆ astarte_data_from_binaryblob_array()

astarte_data_t astarte_data_from_binaryblob_array ( const void ** blobs,
size_t * sizes,
size_t count )

Initialize an astarte data from the input binaryblob array.

Parameters
[in]blobsA bi-dimensional array, the size of each array is contained in sizes while the number of arrays is contained in count
[in]sizesArray of sizes, each entry will be the size of the corresponding array contained in blobs
[in]countNumber of arrays contained in blobs
Returns
The astarte data that wraps the binaryblob array input.

◆ astarte_data_from_boolean()

astarte_data_t astarte_data_from_boolean ( bool val)

Initialize an astarte data from the input boolean.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the boolean input.

◆ astarte_data_from_boolean_array()

astarte_data_t astarte_data_from_boolean_array ( const bool * buf,
size_t len )

Initialize an astarte data from the input boolean array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the boolean array input.

◆ astarte_data_from_datetime()

astarte_data_t astarte_data_from_datetime ( int64_t val)

Initialize an astarte data from the input datetime.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the datetime input.

◆ astarte_data_from_datetime_array()

astarte_data_t astarte_data_from_datetime_array ( const int64_t * buf,
size_t len )

Initialize an astarte data from the input datetime array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the datetime array input.

◆ astarte_data_from_double()

astarte_data_t astarte_data_from_double ( double val)

Initialize an astarte data from the input double.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the double input.

◆ astarte_data_from_double_array()

astarte_data_t astarte_data_from_double_array ( const double * buf,
size_t len )

Initialize an astarte data from the input double array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the double array input.

◆ astarte_data_from_integer()

astarte_data_t astarte_data_from_integer ( int32_t val)

Initialize an astarte data from the input integer.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the integer input.

◆ astarte_data_from_integer_array()

astarte_data_t astarte_data_from_integer_array ( const int32_t * buf,
size_t len )

Initialize an astarte data from the input integer array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the integer array input.

◆ astarte_data_from_longinteger()

astarte_data_t astarte_data_from_longinteger ( int64_t val)

Initialize an astarte data from the input longinteger.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the longinteger input.

◆ astarte_data_from_longinteger_array()

astarte_data_t astarte_data_from_longinteger_array ( const int64_t * buf,
size_t len )

Initialize an astarte data from the input longinteger array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the longinteger array input.

◆ astarte_data_from_string()

astarte_data_t astarte_data_from_string ( const char * val)

Initialize an astarte data from the input string.

Parameters
[in]valInput type that will be inserted in the astarte_data_t.
Returns
The astarte data that wraps the string input.

◆ astarte_data_from_string_array()

astarte_data_t astarte_data_from_string_array ( const char ** buf,
size_t len )

Initialize an astarte data from the input string array.

Parameters
[in]bufInput type that will be inserted in the astarte_data_t.
[in]lenThe length of the input array.
Returns
The astarte data that wraps the string array input.

◆ astarte_data_get_type()

astarte_mapping_type_t astarte_data_get_type ( astarte_data_t data)

Get the type of Astarte data.

Parameters
[in]dataAstarte data for which to check the type.
Returns
The astarte data type.

◆ astarte_data_to_binaryblob()

astarte_result_t astarte_data_to_binaryblob ( astarte_data_t data,
const void ** buf,
size_t * len )

Convert Astarte data (of the binary blob type) to an array of binary blobs.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_binaryblob_array()

astarte_result_t astarte_data_to_binaryblob_array ( astarte_data_t data,
const void *** blobs,
size_t ** sizes,
size_t * count )

Convert Astarte data (of binaryblob array type) to an array of binaryblob arrays.

Parameters
[in]dataAstarte data to use for the extraction.
[out]blobsBi-dimensional array of binary blobs.
[out]sizesArray of sizes (second dimension) of blobs
[out]countNumber or arrays (first dimension) of blobs
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_boolean()

astarte_result_t astarte_data_to_boolean ( astarte_data_t data,
bool * val )

Convert Astarte data (of the boolean type) to a bool.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valExtracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_boolean_array()

astarte_result_t astarte_data_to_boolean_array ( astarte_data_t data,
const bool ** buf,
size_t * len )

Convert Astarte data (of boolean array type) to a bool array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_datetime()

astarte_result_t astarte_data_to_datetime ( astarte_data_t data,
int64_t * val )

Convert Astarte data (of the datetime type) to an int64_t.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valExtracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_datetime_array()

astarte_result_t astarte_data_to_datetime_array ( astarte_data_t data,
const int64_t ** buf,
size_t * len )

Convert Astarte data (of datetime array type) to an int64_t array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_double()

astarte_result_t astarte_data_to_double ( astarte_data_t data,
double * val )

Convert Astarte data (of double type) to a double.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valDouble where to store the extracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_double_array()

astarte_result_t astarte_data_to_double_array ( astarte_data_t data,
const double ** buf,
size_t * len )

Convert Astarte data (of double array type) to a double array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_integer()

astarte_result_t astarte_data_to_integer ( astarte_data_t data,
int32_t * val )

Convert Astarte data (of the integer type) to an int32_t.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valExtracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_integer_array()

astarte_result_t astarte_data_to_integer_array ( astarte_data_t data,
const int32_t ** buf,
size_t * len )

Convert Astarte data (of integer array type) to an int32_t array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_longinteger()

astarte_result_t astarte_data_to_longinteger ( astarte_data_t data,
int64_t * val )

Convert Astarte data (of the long integer type) to an int64_t.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valExtracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_longinteger_array()

astarte_result_t astarte_data_to_longinteger_array ( astarte_data_t data,
const int64_t ** buf,
size_t * len )

Convert Astarte data (of longinteger array type) to an int64_t array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_string()

astarte_result_t astarte_data_to_string ( astarte_data_t data,
const char ** val )

Convert Astarte data (of the string type) to a const char *.

Parameters
[in]dataAstarte data to use for the extraction.
[out]valExtracted data.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.

◆ astarte_data_to_string_array()

astarte_result_t astarte_data_to_string_array ( astarte_data_t data,
const char *** buf,
size_t * len )

Convert Astarte data (of string type) to a const char* array.

Parameters
[in]dataAstarte data to use for the extraction.
[out]bufArray extracted.
[out]lenSize of extracted array.
Returns
ASTARTE_RESULT_OK if the conversion was successful, an error otherwise.