| 1 | #ifndef _DIAG_ERR_H_ |
| 2 | #define _DIAG_ERR_H_ |
| 3 | |
| 4 | /* |
| 5 | * freediag - Vehicle Diagnostic Utility |
| 6 | * |
| 7 | * |
| 8 | * Copyright (C) 2001 Richard Almeida & Ibex Ltd ([email protected]) |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program; if not, write to the Free Software |
| 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 23 | * |
| 24 | ************************************************************************* |
| 25 | * |
| 26 | * Error codes returned from diag layers |
| 27 | * |
| 28 | */ |
| 29 | #if defined(__cplusplus) |
| 30 | extern "C" { |
| 31 | #endif |
| 32 | |
| 33 | //Note : update diag_general.c when modifying error codes |
| 34 | //Values should be <0, as many functions return a positive int on success |
| 35 | #define DIAG_ERR_GENERAL -1 /* Unspecified Error */ |
| 36 | #define DIAG_ERR_BADFD -2 /* Invalid FileDescriptor passed to routine */ |
| 37 | #define DIAG_ERR_NOMEM -3 /* Malloc/Calloc/Strdup/etc failed - ran out of memory */ |
| 38 | |
| 39 | #define DIAG_ERR_INIT_NOTSUPP -4 /* Initbus type not supported by H/W */ |
| 40 | #define DIAG_ERR_PROTO_NOTSUPP -5 /* Protocol not supported by H/W */ |
| 41 | #define DIAG_ERR_IOCTL_NOTSUPP -6 /* Ioctl type not supported */ |
| 42 | #define DIAG_ERR_BADIFADAPTER -7 /* L0 adapter comms failed */ |
| 43 | |
| 44 | #define DIAG_ERR_TIMEOUT -8 /* Read/Write timeout */ |
| 45 | |
| 46 | #define DIAG_ERR_BUSERROR -16 /* We detected write error on diag bus */ |
| 47 | #define DIAG_ERR_BADLEN -17 /* Bad length for this i/f */ |
| 48 | #define DIAG_ERR_BADDATA -18 /* Cant decode msg (ever) */ |
| 49 | #define DIAG_ERR_BADCSUM -19 /* Bad checksum in recvd message */ |
| 50 | #define DIAG_ERR_INCDATA -20 /* Incomplete data, need to receive more */ |
| 51 | #define DIAG_ERR_WRONGKB -21 /* Wrong KeyBytes received */ |
| 52 | #define DIAG_ERR_BADRATE -22 /* Bit rate specified doesn't match ECU */ |
| 53 | |
| 54 | #define DIAG_ERR_ECUSAIDNO -32 /* Ecu returned negative */ |
| 55 | #define DIAG_ERR_RCFILE -40 /* trouble with rc/ini file */ |
| 56 | #define DIAG_ERR_CMDFILE -41 /* trouble with sourcing commands */ |
| 57 | |
| 58 | #define DIAG_ERR_BADVAL -43 /* Invalid value passed to routine */ |
| 59 | #define DIAG_ERR_BADCFG -44 /* Bad config param */ |
| 60 | |
| 61 | #if defined(__cplusplus) |
| 62 | } |
| 63 | #endif |
| 64 | #endif /* _DIAG_ERR_H_ */ |
| 65 | |