| 1 | #ifndef _DIAG_DTC_H_ |
| 2 | #define _DIAG_DTC_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 | * |
| 27 | * DTC handling routines |
| 28 | * |
| 29 | */ |
| 30 | |
| 31 | #if defined(__cplusplus) |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
| 35 | #include <stddef.h> |
| 36 | #include <stdint.h> |
| 37 | |
| 38 | enum diag_dtc_protocol { |
| 39 | dtc_proto_j2012 = 1, /* SAE J2012 */ |
| 40 | dtc_proto_int8 = 2, /* 8 bit integer */ |
| 41 | dtc_proto_int16 = 3, /* 16 bit integer */ |
| 42 | dtc_proto_int32 = 4, /* 32 bit integer */ |
| 43 | dtc_proto_text = 5 /* Text String */ |
| 44 | }; |
| 45 | |
| 46 | //do not use *allocs or open handles in diag_dtc_init ! |
| 47 | void diag_dtc_init(void); |
| 48 | |
| 49 | char *diag_dtc_decode(const uint8_t *data, int len, |
| 50 | const char *vehicle, const char *ecu, enum diag_dtc_protocol protocol, |
| 51 | char *buf, const size_t bufsize); |
| 52 | |
| 53 | #if defined(__cplusplus) |
| 54 | } |
| 55 | #endif |
| 56 | #endif // _DIAG_DTC_H_ |
| 57 | |