Astarte Device SDK ESP32
ESP32 device SDK for the Astarte platform
astarte_bson.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018-2023, SECO Mind Srl
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later OR Apache-2.0
5  */
6 
16 #ifndef _ASTARTE_BSON_H_
17 #define _ASTARTE_BSON_H_
18 
19 #include "astarte.h"
20 #include <stdbool.h>
21 #include <stdint.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
42 const void *astarte_bson_key_lookup(const char *key, const void *document, uint8_t *type)
43  __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_lookup' function "
44  "in astarte_bson_deserializer.h")));
55 const void *astarte_bson_first_item(const void *document)
56  __attribute__((deprecated("Please use the 'astarte_bson_deserializer_first_element' function "
57  "in astarte_bson_deserializer.h")));
69 void *astarte_bson_next_item(const void *document, const void *current_item)
70  __attribute__((deprecated("Please use the 'astarte_bson_deserializer_next_element' function "
71  "in astarte_bson_deserializer.h")));
80 const char *astarte_bson_key(const void *item) __attribute__((
81  deprecated("Please use the deserialization functions in astarte_bson_deserializer.h")));
91 const char *astarte_bson_value_to_string(const void *value_ptr, uint32_t *len) __attribute__((
92  deprecated("Please use the 'astarte_bson_deserializer_element_to_string' function "
93  "in astarte_bson_deserializer.h")));
103 const char *astarte_bson_value_to_binary(const void *value_ptr, uint32_t *len) __attribute__((
104  deprecated("Please use the 'astarte_bson_deserializer_element_to_binary' function "
105  "in astarte_bson_deserializer.h")));
118 const void *astarte_bson_value_to_document(const void *value_ptr, uint32_t *len) __attribute__((
119  deprecated("Please use the 'astarte_bson_deserializer_element_to_document' function "
120  "in astarte_bson_deserializer.h")));
132 int8_t astarte_bson_value_to_int8(const void *value_ptr)
133  __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_bool' function "
134  "in astarte_bson_deserializer.h")));
143 int32_t astarte_bson_value_to_int32(const void *value_ptr) __attribute__((
144  deprecated("Please use the 'astarte_bson_deserializer_element_to_int32' function "
145  "in astarte_bson_deserializer.h")));
154 int64_t astarte_bson_value_to_int64(const void *value_ptr) __attribute__((
155  deprecated("Please use the 'astarte_bson_deserializer_element_to_int64' function "
156  "in astarte_bson_deserializer.h")));
165 double astarte_bson_value_to_double(const void *value_ptr) __attribute__((
166  deprecated("Please use the 'astarte_bson_deserializer_element_to_double' function "
167  "in astarte_bson_deserializer.h")));
180 bool astarte_bson_check_validity(const void *document, unsigned int file_size)
181  __attribute__((deprecated("Please use the 'astarte_bson_deserializer_check_validity' function "
182  "in astarte_bson_deserializer.h")));
191 uint32_t astarte_bson_document_size(const void *document) __attribute__((
192  deprecated("Please use the deserialization functions in astarte_bson_deserializer.h")));
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif
Astarte types and defines.
const void * astarte_bson_first_item(const void *document) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_first_element' function " "in astarte_bson_deserializer.h")))
Get a pointer to the first item in a document's list.
const void * astarte_bson_value_to_document(const void *value_ptr, uint32_t *len) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_document' function " "in astarte_bson_deserializer.h")))
Parse a BSON document and return a pointer to the beginning of the document.
int64_t astarte_bson_value_to_int64(const void *value_ptr) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_int64' function " "in astarte_bson_deserializer.h")))
Cast the input element to a int64.
const char * astarte_bson_value_to_binary(const void *value_ptr, uint32_t *len) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_binary' function " "in astarte_bson_deserializer.h")))
Parse a BSON binary and return a pointer to the beginning of the byte array.
void * astarte_bson_next_item(const void *document, const void *current_item) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_next_element' function " "in astarte_bson_deserializer.h")))
Get a pointer to the next item in a document's list.
int32_t astarte_bson_value_to_int32(const void *value_ptr) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_int32' function " "in astarte_bson_deserializer.h")))
Cast the input element to a int32.
const char * astarte_bson_key(const void *item) __attribute__((deprecated("Please use the deserialization functions in astarte_bson_deserializer.h")))
Get a pointer to the string containing an element name.
double astarte_bson_value_to_double(const void *value_ptr) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_double' function " "in astarte_bson_deserializer.h")))
Cast the input element to a double.
const void * astarte_bson_key_lookup(const char *key, const void *document, uint8_t *type) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_lookup' function " "in astarte_bson_deserializer.h")))
Look up the key from the document and return a pointer to the appropriate entry.
const char * astarte_bson_value_to_string(const void *value_ptr, uint32_t *len) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_string' function " "in astarte_bson_deserializer.h")))
Parse a BSON string and return a pointer to the beginning of the UTF-8 string.
uint32_t astarte_bson_document_size(const void *document) __attribute__((deprecated("Please use the deserialization functions in astarte_bson_deserializer.h")))
Get the size of the document.
bool astarte_bson_check_validity(const void *document, unsigned int file_size) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_check_validity' function " "in astarte_bson_deserializer.h")))
Perform some checks on the validity of the BSON.
int8_t astarte_bson_value_to_int8(const void *value_ptr) __attribute__((deprecated("Please use the 'astarte_bson_deserializer_element_to_bool' function " "in astarte_bson_deserializer.h")))
Cast the input element to a int8.