src.dualinventive.com/mtinfo/tcpserver/legacy/common/include/openat-error.h

116 lines
3.4 KiB
C

/*
************************************************************************
**
** Copyright (c) 2008 by
** Arcobel ASIC Design Centre B.V.
** Core|Vision B.V.
** Hambakenwetering 1
** 5231 DD 's-Hertogenbosch
** The Netherlands
**
** All Rights Reserved
**
************************************************************************
*/
/*
************************************************************************
**
** Project name: Dual Inventive: Zelfsignalerende Kortsluit Lans
** Filename: openat-error.h
** Author: Jack Weeland
** Date: December 4, 2008
** File version: 1.00 of December 4, 2008
**
************************************************************************
*/
/*
************************************************************************
**
** Wavecom OpenAT (GPRS and WIP) error code translations
**
************************************************************************
*/
#ifndef _OPENAT_ERROR_H
#define _OPENAT_ERROR_H
// Generic error message (-16..0)
static const char *__OPENAT_GENERIC_ERRSTR[17] = {
"OK", // 0
"ERROR", // -1
"ADL_RET_ERR_PARAM", // -2
"ADL_RET_ERR_UNKNOWN_HDL", // -3
"ADL_RET_ERR_ALREADY_SUBSCRIBED", // -4
"ADL_RET_ERR_NOT_SUBSCRIBED", // -5
"ADL_RET_ERR_FATAL", // -6
"ADL_RET_ERR_BAD_HDL", // -7
"ADL_RET_ERR_BAD_STATE", // -8
"ADL_RET_ERR_PIN_KO", // -9
"ADL_RET_ERR_NO_MORE_HANDLES", // -10
"ADL_RET_ERR_DONE", // -11
"ADL_RET_ERR_OVERFLOW", // -12
"ADL_RET_ERR_NOT_SUPPORTED", // -13
"ADL_RET_ERR_NO_MORE_TIMERS", // -14
"ADL_RET_ERR_NO_MORE_SEMAPHORES", // -15
"ADL_RET_ERR_SERVICE_LOCKED" // -16
};
// Bearer error messages
static const char *__WIP_BEARER_ERRSTR[23] = {
"WIP_BERR_NO_DEV", // -20
"WIP_BERR_ALREADY", // -21
"WIP_BERR_NO_IF", // -22
"WIP_BERR_NO_HDL", // -23
"WIP_BERR_BAD_HDL", // -24
"WIP_BERR_OPTION", // -25
"WIP_BERR_PARAM", // -26
"WIP_BERR_OK_INPROGRESS", // -27
"WIP_BERR_BAD_STATE", // -28
"WIP_BERR_DEV", // -29
"WIP_BERR_NOT_SUPPORTED", // -30
"WIP_BERR_LINE_BUSY", // -31
"WIP_BERR_NO_ANSWER", // -32
"WIP_BERR_NO_CARRIER", // -33
"WIP_BERR_NO_SIM", // -34
"WIP_BERR_PIN_NOT_READY", // -35
"WIP_BERR_GPRS_FAILED", // -36
"WIP_BERR_PPP_LCP_FAILED", // -37
"WIP_BERR_PPP_AUTH_FAILED", // -38
"WIP_BERR_PPP_IPCP_FAILED", // -39
"WIP_BERR_PPP_LINK_FAILED", // -40
"WIP_BERR_PPP_TERM_REQ", // -41
"WIP_BERR_CALL_REFUSED" // -42
};
// Channel error messages (-986..-1000)
static const char *__WIP_CHANNEL_ERRSTR[15] = {
"WIP_CERR_ABORTED", // -1000
"WIP_CERR_CSTATE", // -999
"WIP_CERR_NOT_SUPPORTED", // -998
"WIP_CERR_OUT_OF_RANGE", // -997
"WIP_CERR_MEMORY", // -996
"WIP_CERR_INTERNAL", // -995
"WIP_CERR_INVALID", // -994
"WIP_CERR_DNS_FAILURE", // -993
"WIP_CERR_RESOURCES", // -992
"WIP_CERR_PORT_IN_USE", // -991
"WIP_CERR_REFUSED", // -990
"WIP_CERR_HOST_UNREACHABLE", // -989
"WIP_CERR_NETWORK_UNREACHABLE", // -988
"WIP_CERR_PIPE_BROKEN", // -987
"WIP_CERR_TIMEOUT" // -986
};
#define WAVECOM_ERRORSTR(code) \
((code) <= 0 && (code) >= -16) \
? __OPENAT_GENERIC_ERRSTR[-(code)] \
: ((code) <= -20 && (code) >= -42) \
? __WIP_BEARER_ERRSTR[-((code)+20)] \
: ((code) <= -986 && (code) >= -1000) \
? __WIP_CHANNEL_ERRSTR[1000+(code)] \
: ((code) == 1) \
? "Disconnected" \
: ""
#endif /* _OPENAT_ERROR_H */