Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Sep 15, 2022
1 parent 28b27f7 commit 174dcc1
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 58 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lwesp_includes.h": "c",
"lwesp_pbuf.h": "c",
"lwesp_opt.h": "c",
"lwesp_typedefs.h": "c",
"LWESP_TYPES.h": "c",
"lwesp_opts.h": "c",
"lwesp_buff.h": "c",
"lwesp_debug.h": "c",
Expand All @@ -22,7 +22,8 @@
"lwesp_unicode.h": "c",
"lwesp_ping.h": "c",
"lwesp_threads.h": "c",
"lwesp_int.h": "c"
"lwesp_int.h": "c",
"lwesp_sta.h": "c"
},
"esbonio.sphinx.confDir": ""
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _api_lwesp_typedefs:
.. _api_lwesp_types:

Structures and enumerations
===========================

.. doxygengroup:: LWESP_TYPEDEFS
.. doxygengroup:: LWESP_TYPES
36 changes: 1 addition & 35 deletions lwesp/src/include/lwesp/lwesp_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include <stdint.h>
#include <string.h>
#include "lwesp/lwesp_types.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -48,41 +49,6 @@ extern "C" {
* \{
*/

#define LWESP_DBG_ON 0x80 /*!< Indicates debug is enabled */
#define LWESP_DBG_OFF 0 /*!< Indicates debug is disabled */

/**
* \anchor LWESP_DBG_LVL
* \name Debug levels
* \brief List of debug levels
* \{
*/

#define LWESP_DBG_LVL_ALL 0x00 /*!< Print all messages of all types */
#define LWESP_DBG_LVL_WARNING 0x01 /*!< Print warning and upper messages */
#define LWESP_DBG_LVL_DANGER 0x02 /*!< Print danger errors */
#define LWESP_DBG_LVL_SEVERE 0x03 /*!< Print severe problems affecting program flow */
#define LWESP_DBG_LVL_MASK 0x03 /*!< Mask for getting debug level */

/**
* \}
*/

/**
* \anchor LWESP_DBG_TYPE
* \name Debug types
* \brief List of debug types
* \{
*/

#define LWESP_DBG_TYPE_TRACE 0x40 /*!< Debug trace messages for program flow */
#define LWESP_DBG_TYPE_STATE 0x20 /*!< Debug state messages (such as state machines) */
#define LWESP_DBG_TYPE_ALL (LWESP_DBG_TYPE_TRACE | LWESP_DBG_TYPE_STATE) /*!< All debug types */

/**
* \}
*/

#if LWESP_CFG_DBG && !defined(LWESP_CFG_DBG_OUT)
#warning "LWESP_CFG_DBG_OUT is not defined but debugging is enabled!"
#endif
Expand Down
89 changes: 89 additions & 0 deletions lwesp/src/include/lwesp/lwesp_debug_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* \file lwesp_debug_types.h
* \brief Debugging types
*/

/*
* Copyright (c) 2022 Tilen MAJERLE
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of LwESP - Lightweight ESP-AT parser library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.2-dev
*/
#ifndef LWESP_HDR_DEBUG_TYPES_H
#define LWESP_HDR_DEBUG_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
* \ingroup LWESP_DEBUG
* \{
*/

#define LWESP_DBG_ON 0x80 /*!< Indicates debug is enabled */
#define LWESP_DBG_OFF 0 /*!< Indicates debug is disabled */

/**
* \anchor LWESP_DBG_LVL
* \name Debug levels
* \brief List of debug levels
* \{
*/

#define LWESP_DBG_LVL_ALL 0x00 /*!< Print all messages of all types */
#define LWESP_DBG_LVL_WARNING 0x01 /*!< Print warning and upper messages */
#define LWESP_DBG_LVL_DANGER 0x02 /*!< Print danger errors */
#define LWESP_DBG_LVL_SEVERE 0x03 /*!< Print severe problems affecting program flow */
#define LWESP_DBG_LVL_MASK 0x03 /*!< Mask for getting debug level */

/**
* \}
*/

/**
* \anchor LWESP_DBG_TYPE
* \name Debug types
* \brief List of debug types
* \{
*/

#define LWESP_DBG_TYPE_TRACE 0x40 /*!< Debug trace messages for program flow */
#define LWESP_DBG_TYPE_STATE 0x20 /*!< Debug state messages (such as state machines) */
#define LWESP_DBG_TYPE_ALL (LWESP_DBG_TYPE_TRACE | LWESP_DBG_TYPE_STATE) /*!< All debug types */

/**
* \}
*/

/**
* \}
*/

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* LWESP_HDR_DEBUG_TYPES_H */
3 changes: 2 additions & 1 deletion lwesp/src/include/lwesp/lwesp_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#define LWESP_HDR_INCLUDES_H

#include "lwesp/lwesp_opt.h"
#include "lwesp/lwesp_typedefs.h"
#include "lwesp/lwesp_types.h"

#include "lwesp/lwesp_debug.h"
#include "lwesp/lwesp_buff.h"
#include "lwesp/lwesp_conn.h"
Expand Down
1 change: 1 addition & 0 deletions lwesp/src/include/lwesp/lwesp_opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/* #define LWESP_IGNORE_USER_OPTS */

/* Include application options */
#include "lwesp_debug_types.h"
#ifndef LWESP_IGNORE_USER_OPTS
#include "lwesp_opts.h"
#endif /* LWESP_IGNORE_USER_OPTS */
Expand Down
2 changes: 1 addition & 1 deletion lwesp/src/include/lwesp/lwesp_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
#endif /* __cplusplus */

/**
* \addtogroup LWESP_TYPEDEFS
* \addtogroup LWESP_TYPES
* \{
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* \file lwesp_typedefs.h
* \file lwesp_types.h
* \brief List of structures and enumerations for public usage
*/

Expand Down Expand Up @@ -46,7 +46,7 @@ extern "C" {

/**
* \ingroup LWESP
* \defgroup LWESP_TYPEDEFS Structures and enumerations
* \defgroup LWESP_TYPES Structures and enumerations
* \brief List of core structures and enumerations
* \{
*/
Expand All @@ -56,7 +56,7 @@ extern "C" {
*/

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief Result enumeration used across application functions
*/
typedef enum {
Expand All @@ -83,7 +83,7 @@ typedef enum {
} lwespr_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief List of support ESP devices by firmware
*/
typedef enum {
Expand All @@ -95,7 +95,7 @@ typedef enum {
} lwesp_device_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief List of encryptions of access point
*/
typedef enum {
Expand Down Expand Up @@ -127,7 +127,7 @@ typedef enum {
} lwesp_ap_cipher_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief IP type
*/
typedef enum {
Expand All @@ -136,23 +136,23 @@ typedef enum {
} lwesp_iptype_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief IPv4 address structure
*/
typedef struct {
uint8_t addr[4]; /*!< IP address data */
} lwesp_ip4_addr_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief IPv6 address structure
*/
typedef struct {
uint16_t addr[8]; /*!< IP address data */
} lwesp_ip6_addr_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief IP structure
*/
typedef struct {
Expand Down Expand Up @@ -223,21 +223,21 @@ lwesp_ip_is_valid(const lwesp_ip_t* ip) {
}

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief Port variable
*/
typedef uint16_t lwesp_port_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief MAC address
*/
typedef struct {
uint8_t mac[6]; /*!< MAC address */
} lwesp_mac_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief SW version in semantic versioning format
*/
typedef struct {
Expand Down Expand Up @@ -304,7 +304,7 @@ typedef struct {
} lwesp_sta_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief Date and time structure
*/
typedef struct {
Expand All @@ -318,7 +318,7 @@ typedef struct {
} lwesp_datetime_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief List of possible WiFi modes
*/
typedef enum {
Expand All @@ -334,7 +334,7 @@ typedef enum {
} lwesp_mode_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief List of possible HTTP methods
*/
typedef enum {
Expand Down Expand Up @@ -652,7 +652,7 @@ typedef struct {
} lwesp_buff_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief Linear buffer structure
*/
typedef struct {
Expand All @@ -662,7 +662,7 @@ typedef struct {
} lwesp_linbuff_t;

/**
* \ingroup LWESP_TYPEDEFS
* \ingroup LWESP_TYPES
* \brief Function declaration for API function command event callback function
* \param[in] res: Operation result, member of \ref lwespr_t enumeration
* \param[in] arg: Custom user argument
Expand Down

0 comments on commit 174dcc1

Please sign in to comment.