Prusa MINI Firmware overview
err.c File Reference
#include "lwip/err.h"
#include "lwip/def.h"
#include "lwip/sys.h"
#include "lwip/errno.h"

Functions

int err_to_errno (err_t err)
 

Variables

static const int err_to_errno_table []
 

Detailed Description

Error Management module

Function Documentation

◆ err_to_errno()

int err_to_errno ( err_t  err)
70 {
71  if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_to_errno_table))) {
72  return EIO;
73  }
74  return err_to_errno_table[-err];
75 }

Variable Documentation

◆ err_to_errno_table

const int err_to_errno_table[]
static
Initial value:
= {
0,
ENOMEM,
ENOBUFS,
EWOULDBLOCK,
EHOSTUNREACH,
EINPROGRESS,
EINVAL,
EWOULDBLOCK,
EADDRINUSE,
EALREADY,
EISCONN,
ENOTCONN,
-1,
ECONNABORTED,
ECONNRESET,
ENOTCONN,
EIO
}

Table to quickly map an lwIP error (err_t) to a socket error by using -err as an index

LWIP_ARRAYSIZE
#define LWIP_ARRAYSIZE(x)
Definition: def.h:58
err_t
s8_t err_t
Definition: err.h:57
err_to_errno_table
static const int err_to_errno_table[]
Definition: err.c:48