64 lines
3.3 KiB
C
64 lines
3.3 KiB
C
/*
|
|
* Copyright (c) 2024 Simone Rossetto <simros85@gmail.com>
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
* are permitted provided that the following conditions are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
* this list of conditions and the following disclaimer.
|
|
*
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
*
|
|
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
* may be used to endorse or promote products derived from this software
|
|
* without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
#if !defined(__ESP_WIREGUARD_ERR__H__)
|
|
#define __ESP_WIREGUARD_ERR__H__
|
|
|
|
#if defined(ESP8266)
|
|
typedef int esp_err_t;
|
|
|
|
#define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */
|
|
#define ESP_FAIL -1 /*!< Generic esp_err_t code indicating failure */
|
|
|
|
#define ESP_ERR_NO_MEM 0x101 /*!< Out of memory */
|
|
#define ESP_ERR_INVALID_ARG 0x102 /*!< Invalid argument */
|
|
#define ESP_ERR_INVALID_STATE 0x103 /*!< Invalid state */
|
|
#define ESP_ERR_INVALID_SIZE 0x104 /*!< Invalid size */
|
|
#define ESP_ERR_NOT_FOUND 0x105 /*!< Requested resource not found */
|
|
#define ESP_ERR_NOT_SUPPORTED 0x106 /*!< Operation or feature not supported */
|
|
#define ESP_ERR_TIMEOUT 0x107 /*!< Operation timed out */
|
|
#define ESP_ERR_INVALID_RESPONSE 0x108 /*!< Received response was invalid */
|
|
#define ESP_ERR_INVALID_CRC 0x109 /*!< CRC or checksum was invalid */
|
|
#define ESP_ERR_INVALID_VERSION 0x10A /*!< Version was invalid */
|
|
#define ESP_ERR_INVALID_MAC 0x10B /*!< MAC address was invalid */
|
|
#define ESP_ERR_NOT_FINISHED 0x10C /*!< There are items remained to retrieve */
|
|
|
|
#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */
|
|
#define ESP_ERR_MESH_BASE 0x4000 /*!< Starting number of MESH error codes */
|
|
#define ESP_ERR_FLASH_BASE 0x6000 /*!< Starting number of flash error codes */
|
|
#define ESP_ERR_HW_CRYPTO_BASE 0xc000 /*!< Starting number of HW cryptography module error codes */
|
|
#define ESP_ERR_MEMPROT_BASE 0xd000 /*!< Starting number of Memory Protection API error codes */
|
|
|
|
#else
|
|
#include <esp_err.h>
|
|
#endif
|
|
|
|
#endif // __ESP_WIREGUARD_ERR__H__
|