MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
Loading...
Searching...
No Matches
meshx_err.h
Go to the documentation of this file.
1/**
2 * @file meshx_err.h
3 * @brief MeshX Error Codes
4 *
5 * This file contains the MeshX Error Codes.
6 *
7 * @author Pranjal Chanda
8 */
9
10#ifndef __MESHX_ERR_H__
11#define __MESHX_ERR_H__
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#define MESHX_UNUSED(x) ((void)(x))
20
21#define MESHX_DO_NOTHING do {} while(0)
22
23#define MESHX_WEEK __attribute__((weak))
24
25/* Compiler based definations */
26
27#ifndef MESHX_MALLOC
28#define MESHX_MALLOC malloc
29#endif
30
31#ifndef MESHX_CALOC
32#define MESHX_CALOC calloc
33#endif
34
35#ifndef MESHX_FREE
36#define MESHX_FREE free
37#endif
38
39/**
40 * @brief MeshX Error Codes
41 */
42typedef enum
43{
44 MESHX_SUCCESS = 0, /**< Success */
45 MESHX_FAIL, /**< Failure */
46 MESHX_INVALID_ARG, /**< Invalid Argument */
47 MESHX_ERR_PLAT, /**< Platform Error */
48 MESHX_NO_MEM, /**< No Memory */
49 MESHX_INVALID_STATE, /**< Invalid State */
50 MESHX_NOT_FOUND, /**< Not Found */
51 MESHX_NOT_SUPPORTED, /**< Not Supported */
52 MESHX_TIMEOUT, /**< Timeout */
53 MESHX_ERR_NOT_INIT, /**< Not Initialized */
54
55 /* RO Config Error Codes (Base: 0x4000) */
56 MESHX_ERR_RO_CFG_BASE = 0x4000, /**< RO Config error base */
57 MESHX_ERR_RO_CFG_FORMAT, /**< Invalid Format */
58 MESHX_ERR_RO_CFG_VERSION, /**< Invalid Version */
59 MESHX_ERR_RO_CFG_CRC, /**< CRC Error */
60
61 /* GPIO Error Codes (Base: 0x5000) */
62 MESHX_ERR_GPIO_BASE = 0x5000, /**< GPIO error base */
63 MESHX_ERR_GPIO_INVALID_PIN, /**< Invalid GPIO pin number */
64 MESHX_ERR_GPIO_INVALID_MODE, /**< Invalid GPIO mode for operation */
65 MESHX_ERR_GPIO_INVALID_LEVEL, /**< Invalid GPIO level value */
66 MESHX_ERR_GPIO_INTR_NOT_SUPPORTED, /**< Interrupt not supported on pin */
67 MESHX_ERR_GPIO_INTR_ALREADY_REGISTERED,/**< Interrupt already registered */
68 MESHX_ERR_GPIO_PWM_NOT_SUPPORTED, /**< PWM not supported on pin */
69 MESHX_ERR_GPIO_PWM_INVALID_PARAM, /**< Invalid PWM parameter */
70 MESHX_ERR_GPIO_NOT_INITIALIZED, /**< GPIO subsystem not initialized */
71 MESHX_ERR_GPIO_CONFIG_INVALID, /**< Invalid GPIO configuration */
72 MESHX_ERR_GPIO_HOSTED_MODE, /**< Operation not allowed in hosted mode */
73 MESHX_ERR_GPIO_KV_STORAGE, /**< KV Engine storage error */
74 MESHX_ERR_GPIO_SERIALIZATION, /**< Configuration serialization error */
75
76 MESHX_ERR_MAX /**< Maximum Error */
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* __MESHX_ERR_H__ */
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
@ MESHX_ERR_RO_CFG_VERSION
Definition meshx_err.h:58
@ MESHX_INVALID_ARG
Definition meshx_err.h:46
@ MESHX_NOT_SUPPORTED
Definition meshx_err.h:51
@ MESHX_ERR_GPIO_BASE
Definition meshx_err.h:62
@ MESHX_ERR_RO_CFG_BASE
Definition meshx_err.h:56
@ MESHX_FAIL
Definition meshx_err.h:45
@ MESHX_ERR_GPIO_INVALID_PIN
Definition meshx_err.h:63
@ MESHX_ERR_GPIO_KV_STORAGE
Definition meshx_err.h:73
@ MESHX_ERR_GPIO_CONFIG_INVALID
Definition meshx_err.h:71
@ MESHX_ERR_PLAT
Definition meshx_err.h:47
@ MESHX_ERR_GPIO_INVALID_LEVEL
Definition meshx_err.h:65
@ MESHX_ERR_GPIO_PWM_NOT_SUPPORTED
Definition meshx_err.h:68
@ MESHX_ERR_MAX
Definition meshx_err.h:76
@ MESHX_ERR_GPIO_INTR_NOT_SUPPORTED
Definition meshx_err.h:66
@ MESHX_ERR_GPIO_INVALID_MODE
Definition meshx_err.h:64
@ MESHX_ERR_NOT_INIT
Definition meshx_err.h:53
@ MESHX_ERR_GPIO_NOT_INITIALIZED
Definition meshx_err.h:70
@ MESHX_INVALID_STATE
Definition meshx_err.h:49
@ MESHX_ERR_GPIO_HOSTED_MODE
Definition meshx_err.h:72
@ MESHX_ERR_GPIO_PWM_INVALID_PARAM
Definition meshx_err.h:69
@ MESHX_NOT_FOUND
Definition meshx_err.h:50
@ MESHX_NO_MEM
Definition meshx_err.h:48
@ MESHX_ERR_RO_CFG_FORMAT
Definition meshx_err.h:57
@ MESHX_TIMEOUT
Definition meshx_err.h:52
@ MESHX_ERR_GPIO_SERIALIZATION
Definition meshx_err.h:74
@ MESHX_ERR_RO_CFG_CRC
Definition meshx_err.h:59
@ MESHX_ERR_GPIO_INTR_ALREADY_REGISTERED
Definition meshx_err.h:67
**This function is called by the parent element when a state change request *is received It validates the request and returns a result to the element not the model layer **return * MESHX_SUCCESS
Definition meshx_model_level.cpp:385