mn_error.hpp File Reference

A list of all error codes in this lib. This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ). More...

#include "mn_config.hpp"

Go to the source code of this file.

Macros

#define MN_ESP2MNTHREAD_ERROR_BEGIN(_error)   switch(_error) {
 
#define MN_ESP2MNTHREAD_ERROR_VAL(_error, esp, mnt)   case (esp): _error = (mnt); break;
 
#define MN_ESP2MNTHREAD_ERROR_END(_error)   default: _error = (ERR_MNTHREAD_UNKN); break; }
 
#define NO_ERROR   0x0000
 
#define ERR_MNTHREAD_TIMEOUT   0x0001
 
#define ERR_MNTHREAD_NULL   0x0002
 
#define ERR_MNTHREAD_NOT_SUPPORTED   0x0005
 
#define ERR_MNTHREAD_UNKN   0x0003
 
#define ERR_MNTHREAD_INVALID_ARG   0x0004
 
#define ERR_MNTHREAD_NETIF_NOT_INIT   0x0006
 
#define ERR_MNTHREAD_OUTOFMEM   0x0007
 
#define ERR_SYSTEM_OK   NO_ERROR
 
#define ERR_SYSTEM_LOCK   0x0008
 
#define ERR_SYSTEM_UNLOCK   0x0009
 
#define ERR_SYSTEM_NO_RETURN   0x000A
 
#define ERR_MUTEX_OK   NO_ERROR
 
#define ERR_MUTEX_ALREADYINIT   0x1001
 
#define ERR_MUTEX_NOTINIT   0x1002
 
#define ERR_MUTEX_CANTCREATEMUTEX   0x1003
 
#define ERR_MUTEX_LOCK   0x1004
 
#define ERR_MUTEX_UNLOCK   0x1005
 
#define ERR_SPINLOCK_OK   NO_ERROR
 
#define ERR_SPINLOCK_ALREADYINIT   0x2001
 
#define ERR_SPINLOCK_NOTINIT   0x2002
 
#define ERR_SPINLOCK_CANTCREATESPINLOCK   0x2003
 
#define ERR_SPINLOCK_LOCK   0x2004
 
#define ERR_SPINLOCK_UNLOCK   0x2005
 
#define ERR_SPINLOCK_BAD_INITIALCOUNT   0x2006
 
#define ERR_TASK_OK   NO_ERROR
 
#define ERR_TASK_CANTINITMUTEX   0x3001
 
#define ERR_TASK_CANTSTARTTHREAD   0x3002
 
#define ERR_TASK_THREADFUNCNOTSET   0x3003
 
#define ERR_TASK_NOTRUNNING   0x3004
 
#define ERR_TASK_ALREADYRUNNING   0x3005
 
#define ERR_TASK_CALLFROMSELFTASK   0x3006
 
#define ERR_TASK_CANTCREATEEVENTGROUP   0x3007
 
#define ERR_COROUTINE_OK   NO_ERROR
 
#define ERR_COROUTINE_CANTINITLOCKT   0x4001
 
#define ERR_COROUTINE_CANSHEDULE   0x4002
 
#define ERR_QUEUE_OK   NO_ERROR
 
#define ERR_QUEUE_ALREADYINIT   0x5001
 
#define ERR_QUEUE_CANTCREATE   0x5002
 
#define ERR_QUEUE_NOTCREATED   0x5003
 
#define ERR_QUEUE_ADD   0x5004
 
#define ERR_QUEUE_REMOVE   0x5005
 
#define ERR_QUEUE_PEEK   0x5006
 
#define ERR_QUEUE_CANTCREATE_LOCK   0x5007
 
#define ERR_TIMER_OK   NO_ERROR
 
#define ERR_TIMER_ALREADYINIT   0x6001
 
#define ERR_TIMER_CANTCREATE   0x6002
 
#define ERR_TIMER_NOTCREATED   0x6003
 
#define ERR_TIMER_AKTIVATE   0x6004
 
#define ERR_TIMER_INAKTIVATE   0x6005
 
#define ERR_TIMER_RESET   0x6006
 
#define ERR_WORKQUEUE_OK   NO_ERROR
 
#define ERR_WORKQUEUE_ALREADYINIT   0x7001
 
#define ERR_WORKQUEUE_CANTCREATE   0x7002
 
#define ERR_WORKQUEUE_WARNING   0x7003
 
#define ERR_WORKQUEUE_CANTINITMUTEX   0x7004
 
#define ERR_WORKQUEUE_ADD   0x7005
 
#define ERR_MEMPOOL_OK   NO_ERROR
 
#define ERR_MEMPOOL_BADALIGNMENT   0x8003
 
#define ERR_MEMPOOL_CREATE   0x8004
 
#define ERR_MEMPOOL_MIN   0x8005
 
#define ERR_TICKHOOK_OK   NO_ERROR
 
#define ERR_TICKHOOK_ADD   0x9001
 
#define ERR_TICKHOOK_ENTRY_NULL   0x900A
 
#define ERR_MN_WIFI_OK   NO_ERROR
 
#define ERR_MN_WIFI_NOT_INIT   0xA001
 
#define ERR_MN_WIFI_NOT_STARTED   0xA002
 
#define ERR_MN_WIFI_NOT_STOPPED   0xA003
 
#define ERR_MN_WIFI_IF   0xA004
 
#define ERR_MN_WIFI_MODE   0xA005
 
#define ERR_MN_WIFI_STATE   0xA006
 
#define ERR_MN_WIFI_CONN   0xA007
 
#define ERR_MN_WIFI_NVS   0xA008
 
#define ERR_MN_WIFI_MAC   0xA009
 
#define ERR_MN_WIFI_SSID   0xA00A
 
#define ERR_MN_WIFI_PASSWORD   0xA00B
 
#define ERR_MN_WIFI_TIMEOUT   0xA00C
 
#define ERR_MN_WIFI_WAKE_FAIL   0xA00D
 
#define ERR_MN_WIFI_WOULD_BLOCK   0xA00E
 
#define ERR_MN_WIFI_NOT_CONNECT   0xA00F
 
#define ERR_MN_WIFI_CREATE_NETIF   0xA011
 
#define ERR_MN_WIFI_REGISTER_EVENT   0xA012
 
#define ERR_MN_WIFI_SET_MODE   0xA013
 
#define ERR_MN_WIFI_POST   0xA022
 
#define ERR_MN_WIFI_INIT_STATE   0xA023
 
#define ERR_MN_WIFI_STOP_STATE   0xA024
 
#define ERR_MN_USER1_BASE   0xD500
 
#define ERR_MN_USER2_BASE   0xE500
 
#define ERR_MN_USER3_BASE   0xFF00
 

Detailed Description

A list of all error codes in this lib. This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ).

Author
Copyright (c) 2021 Amber-Sophia Schroeck
License
The Mini Thread Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3, or (at your option) any later version.

The Mini Thread Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Mini Thread Library; if not, see https://www.gnu.org/licenses/.

Macro Definition Documentation

◆ ERR_COROUTINE_CANSHEDULE

#define ERR_COROUTINE_CANSHEDULE   0x4002

Tasklet can not created

◆ ERR_COROUTINE_CANTINITLOCKT

#define ERR_COROUTINE_CANTINITLOCKT   0x4001

Can not create the lock object for the tasklet, tasklet not created

◆ ERR_COROUTINE_OK

#define ERR_COROUTINE_OK   NO_ERROR

No Error in one of the Tasklet function

◆ ERR_MEMPOOL_BADALIGNMENT

#define ERR_MEMPOOL_BADALIGNMENT   0x8003

The given ligent im mempool are bad

◆ ERR_MEMPOOL_CREATE

#define ERR_MEMPOOL_CREATE   0x8004

The mempool can not create

◆ ERR_MEMPOOL_MIN

#define ERR_MEMPOOL_MIN   0x8005

Reserve

◆ ERR_MEMPOOL_OK

#define ERR_MEMPOOL_OK   NO_ERROR

No error

◆ ERR_MN_USER1_BASE

#define ERR_MN_USER1_BASE   0xD500

◆ ERR_MN_USER2_BASE

#define ERR_MN_USER2_BASE   0xE500

◆ ERR_MN_USER3_BASE

#define ERR_MN_USER3_BASE   0xFF00

◆ ERR_MN_WIFI_CONN

#define ERR_MN_WIFI_CONN   0xA007

WiFi internal control block of station or soft-AP error

◆ ERR_MN_WIFI_CREATE_NETIF

#define ERR_MN_WIFI_CREATE_NETIF   0xA011

◆ ERR_MN_WIFI_IF

#define ERR_MN_WIFI_IF   0xA004

WiFi interface error

◆ ERR_MN_WIFI_INIT_STATE

#define ERR_MN_WIFI_INIT_STATE   0xA023

Invalid WiFi state when init/deinit is called

◆ ERR_MN_WIFI_MAC

#define ERR_MN_WIFI_MAC   0xA009

MAC address is invalid

◆ ERR_MN_WIFI_MODE

#define ERR_MN_WIFI_MODE   0xA005

WiFi mode error

◆ ERR_MN_WIFI_NOT_CONNECT

#define ERR_MN_WIFI_NOT_CONNECT   0xA00F

Station still in disconnect status

◆ ERR_MN_WIFI_NOT_INIT

#define ERR_MN_WIFI_NOT_INIT   0xA001

WiFi driver was not installed by esp_wifi_init

◆ ERR_MN_WIFI_NOT_STARTED

#define ERR_MN_WIFI_NOT_STARTED   0xA002

WiFi driver was not started by esp_wifi_start

◆ ERR_MN_WIFI_NOT_STOPPED

#define ERR_MN_WIFI_NOT_STOPPED   0xA003

WiFi driver was not stopped by esp_wifi_stop

◆ ERR_MN_WIFI_NVS

#define ERR_MN_WIFI_NVS   0xA008

WiFi internal NVS module error

◆ ERR_MN_WIFI_OK

#define ERR_MN_WIFI_OK   NO_ERROR

◆ ERR_MN_WIFI_PASSWORD

#define ERR_MN_WIFI_PASSWORD   0xA00B

Password is invalid

◆ ERR_MN_WIFI_POST

#define ERR_MN_WIFI_POST   0xA022

Failed to post the event to WiFi task

◆ ERR_MN_WIFI_REGISTER_EVENT

#define ERR_MN_WIFI_REGISTER_EVENT   0xA012

◆ ERR_MN_WIFI_SET_MODE

#define ERR_MN_WIFI_SET_MODE   0xA013

◆ ERR_MN_WIFI_SSID

#define ERR_MN_WIFI_SSID   0xA00A

SSID is invalid

◆ ERR_MN_WIFI_STATE

#define ERR_MN_WIFI_STATE   0xA006

WiFi internal state error

◆ ERR_MN_WIFI_STOP_STATE

#define ERR_MN_WIFI_STOP_STATE   0xA024

Returned when WiFi is stopping

◆ ERR_MN_WIFI_TIMEOUT

#define ERR_MN_WIFI_TIMEOUT   0xA00C

Timeout error

◆ ERR_MN_WIFI_WAKE_FAIL

#define ERR_MN_WIFI_WAKE_FAIL   0xA00D

WiFi is in sleep state(RF closed) and wakeup fail

◆ ERR_MN_WIFI_WOULD_BLOCK

#define ERR_MN_WIFI_WOULD_BLOCK   0xA00E

The caller would block

◆ ERR_MNTHREAD_INVALID_ARG

#define ERR_MNTHREAD_INVALID_ARG   0x0004

Invalig Arguments

◆ ERR_MNTHREAD_NETIF_NOT_INIT

#define ERR_MNTHREAD_NETIF_NOT_INIT   0x0006

ERR_MNTHREAD_NETIF_NOT_INIT

◆ ERR_MNTHREAD_NOT_SUPPORTED

#define ERR_MNTHREAD_NOT_SUPPORTED   0x0005

The function is not supported

◆ ERR_MNTHREAD_NULL

#define ERR_MNTHREAD_NULL   0x0002

The given param was null or error in malloc

◆ ERR_MNTHREAD_OUTOFMEM

#define ERR_MNTHREAD_OUTOFMEM   0x0007

Out of mem

◆ ERR_MNTHREAD_TIMEOUT

#define ERR_MNTHREAD_TIMEOUT   0x0001

Timed out

◆ ERR_MNTHREAD_UNKN

#define ERR_MNTHREAD_UNKN   0x0003

Currently not defined error

◆ ERR_MUTEX_ALREADYINIT

#define ERR_MUTEX_ALREADYINIT   0x1001

The mutex allready created

◆ ERR_MUTEX_CANTCREATEMUTEX

#define ERR_MUTEX_CANTCREATEMUTEX   0x1003

The mutex can't create

◆ ERR_MUTEX_LOCK

#define ERR_MUTEX_LOCK   0x1004

It timed out on lock the mutex - mutex are not locked

◆ ERR_MUTEX_NOTINIT

#define ERR_MUTEX_NOTINIT   0x1002

The mutex is not created, please call create first

◆ ERR_MUTEX_OK

#define ERR_MUTEX_OK   NO_ERROR

No Error in one of the mutex function

◆ ERR_MUTEX_UNLOCK

#define ERR_MUTEX_UNLOCK   0x1005

Error to unlock the mutex, call lock first

◆ ERR_QUEUE_ADD

#define ERR_QUEUE_ADD   0x5004

The item can not enqueued in the queue

◆ ERR_QUEUE_ALREADYINIT

#define ERR_QUEUE_ALREADYINIT   0x5001

The queue is allready Created

◆ ERR_QUEUE_CANTCREATE

#define ERR_QUEUE_CANTCREATE   0x5002

The queue can't created

◆ ERR_QUEUE_CANTCREATE_LOCK

#define ERR_QUEUE_CANTCREATE_LOCK   0x5007

Can not create the lock object for the blocking queue

◆ ERR_QUEUE_NOTCREATED

#define ERR_QUEUE_NOTCREATED   0x5003

The queue is not created

◆ ERR_QUEUE_OK

#define ERR_QUEUE_OK   NO_ERROR

No Error in one of the Queue function

◆ ERR_QUEUE_PEEK

#define ERR_QUEUE_PEEK   0x5006

No items in the queue

◆ ERR_QUEUE_REMOVE

#define ERR_QUEUE_REMOVE   0x5005

The item can not remove from the queue

◆ ERR_SPINLOCK_ALREADYINIT

#define ERR_SPINLOCK_ALREADYINIT   0x2001

The spinlock or semaphore allready created

◆ ERR_SPINLOCK_BAD_INITIALCOUNT

#define ERR_SPINLOCK_BAD_INITIALCOUNT   0x2006

Count is bigger are the max count - spinlock not created

◆ ERR_SPINLOCK_CANTCREATESPINLOCK

#define ERR_SPINLOCK_CANTCREATESPINLOCK   0x2003

The spinlock or semaphore can't create

◆ ERR_SPINLOCK_LOCK

#define ERR_SPINLOCK_LOCK   0x2004

It timed out on lock the spinlock or semaphore - not locked

◆ ERR_SPINLOCK_NOTINIT

#define ERR_SPINLOCK_NOTINIT   0x2002

The spinlock or semaphore is not created, please call create first

◆ ERR_SPINLOCK_OK

#define ERR_SPINLOCK_OK   NO_ERROR

No Error in one of the spinlock or semaphore function

◆ ERR_SPINLOCK_UNLOCK

#define ERR_SPINLOCK_UNLOCK   0x2005

Error to unlock the spinlock or semaphore, call lock first

◆ ERR_SYSTEM_LOCK

#define ERR_SYSTEM_LOCK   0x0008

Basis error - error can not lock

◆ ERR_SYSTEM_NO_RETURN

#define ERR_SYSTEM_NO_RETURN   0x000A

Basis error - error in called functions

◆ ERR_SYSTEM_OK

#define ERR_SYSTEM_OK   NO_ERROR

Basis error - no error

◆ ERR_SYSTEM_UNLOCK

#define ERR_SYSTEM_UNLOCK   0x0009

Basis error - error can not unlock

◆ ERR_TASK_ALREADYRUNNING

#define ERR_TASK_ALREADYRUNNING   0x3005

The thread can not start, becourse the thread is allready started

◆ ERR_TASK_CALLFROMSELFTASK

#define ERR_TASK_CALLFROMSELFTASK   0x3006

Call task function wait and join from this task - this will not work!

◆ ERR_TASK_CANTCREATEEVENTGROUP

#define ERR_TASK_CANTCREATEEVENTGROUP   0x3007

The Lock objects are maked error

◆ ERR_TASK_CANTINITMUTEX

#define ERR_TASK_CANTINITMUTEX   0x3001

The Lock objects are maked error

◆ ERR_TASK_CANTSTARTTHREAD

#define ERR_TASK_CANTSTARTTHREAD   0x3002

The thread (i.e. task) can not start unknown error

◆ ERR_TASK_NOTRUNNING

#define ERR_TASK_NOTRUNNING   0x3004

The thread is not running

◆ ERR_TASK_OK

#define ERR_TASK_OK   NO_ERROR

No Error in one of the Thread function

◆ ERR_TASK_THREADFUNCNOTSET

#define ERR_TASK_THREADFUNCNOTSET   0x3003

The threah function is null

◆ ERR_TICKHOOK_ADD

#define ERR_TICKHOOK_ADD   0x9001

Error to add a new tickhook

◆ ERR_TICKHOOK_ENTRY_NULL

#define ERR_TICKHOOK_ENTRY_NULL   0x900A

The entry is null

◆ ERR_TICKHOOK_OK

#define ERR_TICKHOOK_OK   NO_ERROR

No Error in one of the tickhook function

◆ ERR_TIMER_AKTIVATE

#define ERR_TIMER_AKTIVATE   0x6004

The timer can not start

◆ ERR_TIMER_ALREADYINIT

#define ERR_TIMER_ALREADYINIT   0x6001

The timer is allready Created

◆ ERR_TIMER_CANTCREATE

#define ERR_TIMER_CANTCREATE   0x6002

The timer can't created

◆ ERR_TIMER_INAKTIVATE

#define ERR_TIMER_INAKTIVATE   0x6005

The timer can not stop

◆ ERR_TIMER_NOTCREATED

#define ERR_TIMER_NOTCREATED   0x6003

The timer is not created

◆ ERR_TIMER_OK

#define ERR_TIMER_OK   NO_ERROR

No Error in one of the Timer function

◆ ERR_TIMER_RESET

#define ERR_TIMER_RESET   0x6006

The timer can not reset

◆ ERR_WORKQUEUE_ADD

#define ERR_WORKQUEUE_ADD   0x7005

The item can not add to the workqueue

◆ ERR_WORKQUEUE_ALREADYINIT

#define ERR_WORKQUEUE_ALREADYINIT   0x7001

The workqueue is allready Created

◆ ERR_WORKQUEUE_CANTCREATE

#define ERR_WORKQUEUE_CANTCREATE   0x7002

The workqueue can't created

◆ ERR_WORKQUEUE_CANTINITMUTEX

#define ERR_WORKQUEUE_CANTINITMUTEX   0x7004

The mutex can not init

◆ ERR_WORKQUEUE_OK

#define ERR_WORKQUEUE_OK   NO_ERROR

No Error in one of the workqueue function

◆ ERR_WORKQUEUE_WARNING

#define ERR_WORKQUEUE_WARNING   0x7003

Warning

◆ MN_ESP2MNTHREAD_ERROR_BEGIN

#define MN_ESP2MNTHREAD_ERROR_BEGIN (   _error)    switch(_error) {

Begin the helper macro to switch ESP_ERRORS to MNTHREAD_ERROR errors

Parameters
_errorThe holder of the error value
int _error = esp_netif_set_mac(m_pNetIf, mac);
MN_ESP2MNTHREAD_ERROR_VAL(_error, ESP_ERR_ESP_NETIF_IF_NOT_READY, ERR_MNTHREAD_NETIF_NOT_INIT);
MN_ESP2MNTHREAD_ERROR_VAL(_error, ESP_ERR_NOT_SUPPORTED, ERR_MNTHREAD_NOT_SUPPORTED);
#define MN_ESP2MNTHREAD_ERROR_END(_error)
Definition: mn_error.hpp:51
#define NO_ERROR
Definition: mn_error.hpp:53
#define ERR_MNTHREAD_NOT_SUPPORTED
Definition: mn_error.hpp:56
#define MN_ESP2MNTHREAD_ERROR_VAL(_error, esp, mnt)
Definition: mn_error.hpp:46
#define MN_ESP2MNTHREAD_ERROR_BEGIN(_error)
Definition: mn_error.hpp:39
#define ERR_MNTHREAD_NETIF_NOT_INIT
Definition: mn_error.hpp:59

◆ MN_ESP2MNTHREAD_ERROR_END

#define MN_ESP2MNTHREAD_ERROR_END (   _error)    default: _error = (ERR_MNTHREAD_UNKN); break; }

End the helper macro to switch ESP_ERRORS to MNTHREAD_ERROR errors

Parameters
_errorThe holder of the error value - set to ERR_MNTHREAD_UNKN

◆ MN_ESP2MNTHREAD_ERROR_VAL

#define MN_ESP2MNTHREAD_ERROR_VAL (   _error,
  esp,
  mnt 
)    case (esp): _error = (mnt); break;

the helper macro to switch ESP_ERRORS to MNTHREAD_ERROR errors

Parameters
_errorThe holder of the error value and holder of the MNTHREAD_ERROR code
espThe esp value to find
mntThe MNTHREAD_ERROR to set

◆ NO_ERROR

#define NO_ERROR   0x0000

No Error