forked from astarte-platform/astarte-device-sdk-esp32
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simone Orru <[email protected]>
- Loading branch information
Showing
14 changed files
with
683 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* (C) Copyright 2023, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* @file astarte_interface_gen.h | ||
* @brief Contains automatically generated interfaces. | ||
* | ||
* @details The generated structures contain all information regarding each interface. | ||
* and are automatically generated from the json interfaces definitions. | ||
*/ | ||
|
||
#ifndef _ASTARTE_INTERFACE_GEN_H_ | ||
#define _ASTARTE_INTERFACE_GEN_H_ | ||
|
||
#include "astarte_interface.h" | ||
|
||
extern const astarte_interface_t astarte_interface_org_astarteplatform_esp32_examples_DeviceAggregate; | ||
extern const astarte_interface_t astarte_interface_org_astarteplatform_esp32_examples_ServerAggregate; | ||
|
||
#endif /* _ASTARTE_INTERFACE_GEN_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* (C) Copyright 2023, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* @file astarte_interface_gen.c | ||
* @brief Contains automatically generated interfaces. | ||
*/ | ||
|
||
#include "astarte_interface_gen.h" | ||
|
||
static const astarte_mapping_t astarte_mappings_org_astarteplatform_esp32_examples_DeviceAggregate[4] = { | ||
{ | ||
.endpoint = "/%{sensor_id}/double_endpoint", | ||
.type = TYPE_DOUBLE, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
{ | ||
.endpoint = "/%{sensor_id}/integer_endpoint", | ||
.type = TYPE_INTEGER, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
{ | ||
.endpoint = "/%{sensor_id}/boolean_endpoint", | ||
.type = TYPE_BOOLEAN, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
{ | ||
.endpoint = "/%{sensor_id}/doublearray_endpoint", | ||
.type = TYPE_DOUBLEARRAY, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
}; | ||
|
||
const astarte_interface_t astarte_interface_org_astarteplatform_esp32_examples_DeviceAggregate = { | ||
.name = "org.astarteplatform.esp32.examples.DeviceAggregate", | ||
.major_version = 0, | ||
.minor_version = 1, | ||
.type = TYPE_DATASTREAM, | ||
.ownership = OWNERSHIP_DEVICE, | ||
.aggregation = AGGREGATION_OBJECT, | ||
.mappings = astarte_mappings_org_astarteplatform_esp32_examples_DeviceAggregate, | ||
}; | ||
|
||
static const astarte_mapping_t astarte_mappings_org_astarteplatform_esp32_examples_ServerAggregate[2] = { | ||
{ | ||
.endpoint = "/%{sensor_id}/booleanarray_endpoint", | ||
.type = TYPE_BOOLEANARRAY, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
{ | ||
.endpoint = "/%{sensor_id}/longinteger_endpoint", | ||
.type = TYPE_LONGINTEGER, | ||
.reliability = RELIABILITY_UNRELIABLE, | ||
.explicit_timestamp = true, | ||
.allow_unset = false, | ||
}, | ||
}; | ||
|
||
const astarte_interface_t astarte_interface_org_astarteplatform_esp32_examples_ServerAggregate = { | ||
.name = "org.astarteplatform.esp32.examples.ServerAggregate", | ||
.major_version = 0, | ||
.minor_version = 1, | ||
.type = TYPE_DATASTREAM, | ||
.ownership = OWNERSHIP_SERVER, | ||
.aggregation = AGGREGATION_OBJECT, | ||
.mappings = astarte_mappings_org_astarteplatform_esp32_examples_ServerAggregate, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* (C) Copyright 2018-2023, SECO Mind Srl | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* @file astarte_mapping.h | ||
* @brief Generic specifications for Astarte interface mappings. | ||
*/ | ||
|
||
#ifndef _ASTARTE_MAPPING_H_ | ||
#define _ASTARTE_MAPPING_H_ | ||
|
||
#include <stdbool.h> | ||
#include "astarte.h" | ||
|
||
typedef enum { | ||
TYPE_INTEGER = 1, | ||
TYPE_LONGINTEGER, | ||
TYPE_DOUBLE, | ||
TYPE_STRING, | ||
TYPE_BINARYBLOB, | ||
TYPE_BOOLEAN, | ||
TYPE_DATETIME, | ||
TYPE_INTEGERARRAY, | ||
TYPE_LONGINTEGERARRAY, | ||
TYPE_DOUBLEARRAY, | ||
TYPE_STRINGARRAY, | ||
TYPE_BINARYBLOBARRAY, | ||
TYPE_BOOLEANARRAY, | ||
TYPE_DATETIMEARRAY, | ||
} astarte_mapping_type_t; | ||
|
||
typedef enum { | ||
RELIABILITY_UNRELIABLE = 0, | ||
RELIABILITY_GUARANTEED = 1, | ||
RELIABILITY_UNIQUE = 2, | ||
} astarte_mapping_reliability_t; | ||
|
||
typedef struct { | ||
const char *endpoint; | ||
astarte_mapping_type_t type; | ||
astarte_mapping_reliability_t reliability; | ||
bool explicit_timestamp; | ||
bool allow_unset; | ||
} astarte_mapping_t; | ||
|
||
astarte_err_t validate_path(astarte_mapping_t mapping, const char *path, bool *result); | ||
|
||
#endif /* _ASTARTE_MAPPING_H_ */ |
Oops, something went wrong.