Edgehog Device SDK ESP32
ESP32 device SDK for the Edgehog platform
edgehog.h
Go to the documentation of this file.
1 /*
2  * This file is part of Edgehog.
3  *
4  * Copyright 2021 SECO Mind Srl
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  */
20 
26 #ifndef EDGEHOG_H
27 #define EDGEHOG_H
28 
29 #define ASTARTE_UUID_LEN 39
30 
31 // clang-format off
32 
38 typedef enum
39 {
40  EDGEHOG_OK = 0,
53 
54 // clang-format on
55 
56 #define EDGEHOG_VALIDATE_INCOMING_DATA(TAG, EVENT_REQUEST, PATH, BSON_TYPE) \
57  if ((EVENT_REQUEST)->bson_element.type != (BSON_TYPE) \
58  || strcmp((EVENT_REQUEST)->path, (PATH)) != 0) { \
59  ESP_LOGE(TAG, "Unable to handle request on %s having type code %i", (EVENT_REQUEST)->path, \
60  (EVENT_REQUEST)->bson_element.type); \
61  return EDGEHOG_ERR; \
62  }
63 
64 #endif // EDGEHOG_H
edgehog_err_t
Edgehog return codes.
Definition: edgehog.h:39
@ EDGEHOG_ERR_TASK_CREATE
Definition: edgehog.h:50
@ EDGEHOG_ERR_OTA_INVALID_REQUEST
Definition: edgehog.h:44
@ EDGEHOG_ERR_OTA_CANCELED
Definition: edgehog.h:48
@ EDGEHOG_ERR_NETWORK
Definition: edgehog.h:42
@ EDGEHOG_ERR
Definition: edgehog.h:41
@ EDGEHOG_ERR_OTA_ALREADY_IN_PROGRESS
Definition: edgehog.h:45
@ EDGEHOG_ERR_OTA_SYSTEM_ROLLBACK
Definition: edgehog.h:47
@ EDGEHOG_ERR_DEVICE_NOT_READY
Definition: edgehog.h:51
@ EDGEHOG_ERR_NVS
Definition: edgehog.h:43
@ EDGEHOG_ERR_OTA_INTERNAL
Definition: edgehog.h:49
@ EDGEHOG_OK
Definition: edgehog.h:40
@ EDGEHOG_ERR_OTA_INVALID_IMAGE
Definition: edgehog.h:46