165 lines
5.7 KiB
C
165 lines
5.7 KiB
C
/*
|
|
************************************************************************
|
|
**
|
|
** Copyright (c) 2009 by
|
|
** Core|Vision B.V.
|
|
** Cereslaan 10b
|
|
** 5384 VT Heesch
|
|
** The Netherlands
|
|
**
|
|
** All Rights Reserved
|
|
**
|
|
************************************************************************
|
|
*/
|
|
/*
|
|
************************************************************************
|
|
**
|
|
** Project name: Dual Inventive: Communication Protocol 3000
|
|
** Filename: cp3000-errno.h
|
|
** Author: Jack Weeland
|
|
** Date: November 13, 2009
|
|
** File version: 1.00 of November 13, 2009
|
|
**
|
|
************************************************************************
|
|
*/
|
|
/*
|
|
************************************************************************
|
|
**
|
|
** CP3000 and ZKL/ZKL-RC/etc internal errors
|
|
**
|
|
************************************************************************
|
|
*/
|
|
|
|
#ifndef _CP3000_ERRNO_H
|
|
#define _CP3000_ERRNO_H
|
|
|
|
// okay
|
|
#define TCPSTAT_OK 0x00
|
|
#define TCPSTAT_WARNING 0x02 // okay, but only partially
|
|
#define TCPSTAT_BADSTATE 0x03 // state is not as expected, but still okay(ish)
|
|
#define TCPSTAT_SKIPPED 0x04 // device or action is skipped
|
|
|
|
// end of file (on the communication socket)
|
|
#define TCPERR_EOF 0x01
|
|
|
|
// protocol errors
|
|
#define TCPERR_INVAL 0x10 // invalid command or parameter
|
|
#define TCPERR_PARAM 0x11 // parameter count wrong
|
|
#define TCPERR_TOOLONG 0x12 // parameter too long
|
|
#define TCPERR_INTERR 0x13 // internal error
|
|
#define TCPERR_CHKSUM 0x14 // checksum error
|
|
#define TCPERR_STALE 0x15 // data has expired
|
|
#define TCPERR_FILEERR 0x16 // file error (see 'errno')
|
|
#define TCPERR_SECURE 0x17 // security check failed
|
|
|
|
// transient errors, can be retried
|
|
#define TCPERR_BUSY 0x40 // server/peer is busy (try again)
|
|
#define TCPSTAT_BUSY (TCPERR_BUSY)
|
|
#define TCPERR_ABORTED 0x41 // server terminated; try to connect again
|
|
#define TCPERR_TOOMANY 0x42 // too many connections (peer can try again)
|
|
#define TCPERR_ALREADY 0x43 // (trans)action already ongoing
|
|
|
|
// server and device errors
|
|
#define TCPERR_ACCESS 0x80 // access denied
|
|
#define TCPERR_NOFIFO 0x81 // local communication fifo does not exist
|
|
#define TCPERR_DISC 0x82 // zkl closed its connection
|
|
#define TCPERR_UNKNOWN 0x83 // zkl not in the database
|
|
#define TCPERR_NOT_FOUND (TCPERR_UNKNOWN)
|
|
#define TCPERR_CONNECT 0x84 // connection refused (server not running?)
|
|
#define TCPERR_SOCKET 0x85 // socket error on a read or write
|
|
#define TCPERR_TIMEOUT 0x86 // time-out
|
|
#define TCPERR_NOSUPP 0x87 // not supported
|
|
#define TCPERR_NOMEM 0x88 // out of memory
|
|
#define TCPERR_BUFSZ 0x89 // buffer too small
|
|
#define TCPERR_NODATA 0x8A // data source exhausted
|
|
#define TCPERR_DATACHG 0x8B // data changed while this is not allowed or expected
|
|
#define TCPERR_LOCKED 0x8C // access denied because a user or some functionality is locked
|
|
#define TCPERR_BADSTATE 0x8D // the current state is not expected or faulty
|
|
#define TCPERR_DEVICE 0x8E // generic device error
|
|
#define TCPERR_GEOFENCE 0x8F // geo-fencing error
|
|
|
|
// intermediate result - real result code will follow
|
|
#define TCPSTAT_INTERMEDIATE 0xFF
|
|
|
|
/*
|
|
** String table with the errors as strings, if so enabled; indexed by '-error_code'
|
|
*/
|
|
#ifdef _CP3000_ERRNO_DEFINE_STRINGTABLE
|
|
|
|
#define CP3000_ERRSZ 256
|
|
|
|
static const char *CP3000_ERRSTR[CP3000_ERRSZ] =
|
|
{
|
|
"TCPSTAT_OK", // 0
|
|
"TCPERR_EOF", // 1
|
|
"TCPSTAT_WARNING", // 2
|
|
"TCPSTAT_BADSTATE", // 3
|
|
"TCPSTAT_SKIPPED", // 4
|
|
"", // 5
|
|
"", // 6
|
|
"", // 7
|
|
"", "", "", "", "", "", "", "", // 8 .. 15
|
|
"TCPERR_INVAL", // 16
|
|
"TCPERR_PARAM", // 17
|
|
"TCPERR_TOOLONG", // 18
|
|
"TCPERR_INTERR", // 19
|
|
"TCPERR_CHKSUM", // 20
|
|
"TCPERR_STALE", // 21
|
|
"TCPERR_FILEERR", // 22
|
|
"TCPERR_SECURE", // 23
|
|
"", "", "", "", "", "", "", "", // 24 .. 31
|
|
"", "", "", "", "", "", "", "", // 32 ..
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", // .. 63
|
|
"TCPSTAT_BUSY", // 64
|
|
"TCPERR_ABORTED", // 65
|
|
"TCPERR_TOOMANY", // 66
|
|
"TCPERR_ALREADY", // 67
|
|
"", // 68
|
|
"", // 69
|
|
"", // 70
|
|
"", // 71
|
|
"", "", "", "", "", "", "", "", // 72 ..
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", // ..127
|
|
"TCPERR_ACCESS", // 128
|
|
"TCPERR_NOFIFO", // 129
|
|
"TCPERR_DISC", // 130
|
|
"TCPERR_UNKNOWN", // 131
|
|
"TCPERR_CONNECT", // 132
|
|
"TCPERR_SOCKET", // 133
|
|
"TCPERR_TIMEOUT", // 134
|
|
"TCPERR_NOSUPP", // 135
|
|
"TCPERR_NOMEM", // 136
|
|
"TCPERR_BUFSZ", // 137
|
|
"TCPERR_NODATA", // 138
|
|
"TCPERR_DATACHG", // 139
|
|
"TCPERR_LOCKED", // 140
|
|
"TCPERR_BADSTATE", // 141
|
|
"TCPERR_DEVICE", // 142
|
|
"TCPERR_GEOFENCE", // 143
|
|
"", "", "", "", "", "", "", "", // 144 ..
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", "", //
|
|
"", "", "", "", "", "", "", // .. 254
|
|
"TCPSTAT_INTERMEDIATE" // .. 255
|
|
};
|
|
|
|
#endif /* _CP3000_ERRNO_DEFINE_STRINGTABLE */
|
|
#endif /* _CP3000_ERRNO_H */
|