Main Page | Class List | File List | Class Members | File Members | Related Pages

include/otto/data.h

Go to the documentation of this file.
00001 // $Id: data.h,v 1.5 2004/07/05 23:25:39 alpha Exp $ 00002 // 00003 // Copyright (c) 1999-2004 Darius Rad 00004 // 00005 // This file is part of the OpenOtto project. 00006 // 00007 // OpenOtto is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 00017 00018 00019 #ifndef _OTTO_DATA_H 00020 #define _OTTO_DATA_H 00021 00022 00024 union otto_prn 00025 { 00026 int raw; 00027 00028 struct 00029 { 00031 unsigned char seq; 00032 00034 enum 00035 { 00036 OTTO_PRN_OWNER_SAE = 0, 00037 OTTO_PRN_OWNER_MFG1 = 1, 00038 OTTO_PRN_OWNER_MFG2 = 2, 00039 OTTO_PRN_OWNER_MFG3 = 3, 00040 OTTO_PRN_OWNER_MFG4 = 4, 00041 OTTO_PRN_OWNER_MFG5 = 5, 00042 OTTO_PRN_OWNER_MFG6 = 6, 00043 OTTO_PRN_OWNER_MFG7 = 7, 00044 } 00045 owner:3; 00046 00049 unsigned char subgroup:2; 00050 00052 enum 00053 { 00054 OTTO_PRN_SYSTEM_POWERTRAIN = 0, 00055 OTTO_PRN_SYSTEM_CHASSIS = 1, 00056 OTTO_PRN_SYSTEM_BODY1 = 2, 00057 OTTO_PRN_SYSTEM_BODY2 = 3, 00058 OTTO_PRN_SYSTEM_BODY3 = 4, 00059 OTTO_PRN_SYSTEM_BODY4 = 5, 00060 OTTO_PRN_SYSTEM_OTHER1 = 6, 00061 OTTO_PRN_SYSTEM_OTHER2 = 7, 00062 } 00063 system:3; 00064 } 00065 prn; 00066 00067 }; 00068 00069 00071 struct otto_slot 00072 { 00074 enum 00075 { 00076 OTTO_SLOT_PKT = 0, 00077 OTTO_SLOT_BMM, 00078 OTTO_SLOT_BMP, 00079 OTTO_SLOT_UNM, 00080 OTTO_SLOT_SNM, 00081 OTTO_SLOT_SED, 00082 OTTO_SLOT_ASC, 00083 OTTO_SLOT_BCD, 00084 OTTO_SLOT_SFP, 00085 } 00086 format; 00087 00088 int bits; 00089 int seq; 00090 }; 00091 00092 00094 struct otto_prn_table_entry 00095 { 00096 union otto_prn prn; 00097 char *name; 00098 char *units; 00099 struct otto_slot slot; 00100 }; 00101 00102 00104 struct otto_slot_pkt_table_entry 00105 { 00106 struct otto_slot slot; 00107 char *name; 00108 // struct otto_prn prn[]; ///< List of PRNs 00109 int prn[7]; 00110 }; 00111 00112 00114 struct otto_slot_bmp_table_entry 00115 { 00116 struct otto_slot slot; 00117 char *name; 00118 00119 struct 00120 { 00121 char *name; 00122 char *unset; 00123 char *set; 00124 } 00125 bit[]; 00126 }; 00127 00128 00132 struct otto_slot_bmm_table_entry 00133 { 00134 }; 00135 00136 00138 struct otto_slot_unm_table_entry 00139 { 00140 struct otto_slot slot; 00141 float scale; 00142 float min; 00143 float max; 00144 float offset; 00145 }; 00146 00147 00149 struct otto_slot_snm_table_entry 00150 { 00151 struct otto_slot slot; 00152 float scale; 00153 float min; 00154 float max; 00155 float offset; 00156 }; 00157 00158 00160 struct otto_slot_sed_table_entry 00161 { 00162 struct otto_slot slot; 00163 char *name; 00164 00165 struct 00166 { 00167 int value; 00168 char *name; 00169 } 00170 state[]; 00171 }; 00172 00173 00174 // ASC is nothing special 00175 // BCD is also nothing special 00176 00177 00178 // SFP 00179 00180 00183 struct otto_parameter_value 00184 { 00185 struct otto_slot slot; 00186 union 00187 { 00188 int i; 00189 float f; 00190 } 00191 value; 00192 00193 char units[1024]; 00194 }; 00195 00196 00198 union otto_dtc 00199 { 00200 int raw; 00201 00202 struct 00203 { 00204 enum 00205 { 00206 OTTO_DTC_POWERTRAIN = 0, 00207 OTTO_DTC_CHASSIS = 1, 00208 OTTO_DTC_BODY = 2, 00209 OTTO_DTC_NETWORK = 3, 00210 } 00211 des:2; 00212 00213 unsigned char code1000:2; 00214 unsigned char code100:4; 00215 unsigned char code10:4; 00216 unsigned char code1:4; 00217 } 00218 dtc; 00219 }; 00220 00221 00223 int 00224 otto_decode_by_slot( 00225 struct otto_slot *slot, 00226 int in, 00227 int *out 00228 ); 00229 00231 int 00232 otto_encode_by_slot( 00233 struct otto_slot *slot, 00234 int in, 00235 int *out 00236 ); 00237 00240 00243 int 00244 otto_dtc_tostring( 00245 union otto_dtc *dtc, 00246 char *str, 00247 size_t size 00248 ); 00249 00252 int 00253 otto_dtclookup( 00254 union otto_dtc *dtc, 00255 char *desc, 00256 size_t size 00257 ); 00258 00259 00260 #endif

Generated on Thu Jul 8 19:26:04 2004 for OpenOtto by doxygen 1.3.7