kwp2000_service.c 59 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
*********************************************************************
* Includes
*********************************************************************
*/
#include "kwp2000_interface.h"
#include "kwp2000_tp.h"
#include "kwp2000_service.h"

#include "Common_Interface.h"
#include "GUI.h"
/*
*********************************************************************
* structure
*********************************************************************
*/

/*
*********************************************************************
* variable
*********************************************************************
*/
hu's avatar
hu committed
23
Kwp2000_Negative_t Kwp2000_Negative;
hu's avatar
hu committed
24

hu's avatar
hu committed
25
_K_LINE_SIGNAL_FLAG K_LINE_SIGNAL_FLAG;
hu's avatar
hu committed
26

hu's avatar
hu committed
27 28 29 30
unsigned char Sendseed1;
unsigned char Sendseed2;
unsigned char Sendseed3;
unsigned char Sendseed4;
hu's avatar
hu committed
31

hu's avatar
hu committed
32 33 34 35
unsigned char Recvseed1;
unsigned char Recvseed2;
unsigned char Recvseed3;
unsigned char Recvseed4;
hu's avatar
hu committed
36 37 38

unsigned char Seed1, Seed2, Seed3, Seed4;

hu's avatar
hu committed
39
unsigned char DTCstatusCHGFFK_Line = 0u;
hu's avatar
hu committed
40

hu's avatar
hu committed
41 42
unsigned char AccessMode2701KeyTimeFlag;
unsigned char AccessMode2701KeyTime;
hu's avatar
hu committed
43 44 45

unsigned long EOLSeedRandomNumber = 0x6879716169716872ul;

hu's avatar
hu committed
46 47 48
_ECUStatus ECUStatusONE;
_EOL_K_LINE_SET K_Line_Set;

hu's avatar
hu committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
/*
*********************************************************************
* function
*********************************************************************
*/

/*-------------------------------------------------------------------------
* Function Name  : kwp_NegativeResponse
* Description    : Negative Response
* Input          :
* Output         : None
* Return         : None
* onther         :
--------------------------------------------------------------------------*/
unsigned char kwp_NegativeResponse(unsigned char sId_u8, unsigned char NegRC_u8, unsigned char *blockByte)
{
    unsigned char bufPos = 0;

    (*blockByte++) = KWP_NEGATIVE_RESPONSE;
    (*blockByte++) = sId_u8;
    (*blockByte) = NegRC_u8;

    bufPos = 3;

    return (bufPos);
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_EcuReset
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 11
--------------------------------------------------------------------------*/
unsigned char kwp_EcuReset(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;

hu's avatar
hu committed
87
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
88
    {
hu's avatar
hu committed
89
    case 1: /* hardReset */
hu's avatar
hu committed
90
        (*TxData++) = KWP2000_ECURESET_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
91
        (*TxData) = RequestData[0];
hu's avatar
hu committed
92 93
        Tx_Len = 2;
        break;
hu's avatar
hu committed
94
    case 2: /* keyOffOnReset */
hu's avatar
hu committed
95
        (*TxData++) = KWP2000_ECURESET_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
96
        (*TxData) = RequestData[0];
hu's avatar
hu committed
97 98
        Tx_Len = 2;
        break;
hu's avatar
hu committed
99
    case 3: /* softReset */
hu's avatar
hu committed
100
        (*TxData++) = KWP2000_ECURESET_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
101
        (*TxData) = RequestData[0];
hu's avatar
hu committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
        Tx_Len = 2;
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}

/*-------------------------------------------------------------------------
* Function Name  : kwp_TesterPresent
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 3E
--------------------------------------------------------------------------*/
unsigned char kwp_TesterPresent(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
122

hu's avatar
hu committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
    (*TxData) = KWP2000_TESTERPRESENT_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
    Tx_Len = 1;
    return Tx_Len;
}

/*-------------------------------------------------------------------------
* Function Name  : kwp_StartCommunication
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 81
--------------------------------------------------------------------------*/
unsigned char kwp_StartCommunication(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
139

hu's avatar
hu committed
140 141
    K_LINE_SIGNAL_FLAG.RecvStart = 1;

hu's avatar
hu committed
142 143
    (*TxData++) = KWP2000_STARTCOMMUNICATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
    (*TxData++) = KWP2000_KEYBYTE1;
hu's avatar
hu committed
144 145 146 147 148 149 150 151 152 153 154 155
    (*TxData) = KWP2000_KEYBYTE2;
    Tx_Len = 3;

    return Tx_Len;
}

/*-------------------------------------------------------------------------
* Function Name  : kwp_StartCommunication
* Description    :
* Input          :
* Output         : None
* Return         : None
hu's avatar
hu committed
156
* onther         : 82 服务,没有否定应答
hu's avatar
hu committed
157 158 159 160
--------------------------------------------------------------------------*/
unsigned char kwp_StopCommunication(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
161

hu's avatar
hu committed
162 163
    if (K_LINE_SIGNAL_FLAG.RecvStart == 1)
    {
hu's avatar
hu committed
164 165
        K_LINE_SIGNAL_FLAG.RecvStart = 0;            /*EOL诊断结束标识*/
        K_LINE_SIGNAL_FLAG.SendSeedEQUSRecvSeed = 0; /*清空密钥配对成功标识*/
hu's avatar
hu committed
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187

        (*TxData) = KWP2000_STOPCOMMUNICATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        Tx_Len = 1;
    }
    else
    {
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
    }

    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readEcuIdentification
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 1A
--------------------------------------------------------------------------*/
unsigned char kwp_readEcuIdentification(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
188

hu's avatar
hu committed
189
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
190
    {
hu's avatar
hu committed
191
    case 0x81: /* ECUIdentificationScalingTable */
hu's avatar
hu committed
192
        (*TxData++) = KWP2000_READECUIDENTIFICATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
193 194 195 196
        (*TxData++) = RequestData[0];
        (*TxData++) = 0x03; /* Scaling Offset*/
        (*TxData++) = 0x91; /* 汽车制造厂编号*/
        (*TxData++) = 0x6A; /* Ascii 10 byte*/
hu's avatar
hu committed
197 198 199 200 201
        (*TxData++) = 0xFF;
        Tx_Len = 6;
        break;
    case 0x91: /* vehicleManufacturerECUHardwareNumber */
        (*TxData++) = KWP2000_READECUIDENTIFICATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
202
        (*TxData++) = RequestData[0]; /* ISUZU Parts No. 8979683010 */
hu's avatar
hu committed
203 204 205 206 207 208 209 210 211 212
        (*TxData++) = K_Line_Set.No_Digit1;
        (*TxData++) = K_Line_Set.No_Digit2;
        (*TxData++) = K_Line_Set.No_Digit3;
        (*TxData++) = K_Line_Set.No_Digit4;
        (*TxData++) = K_Line_Set.No_Digit5;
        (*TxData++) = K_Line_Set.No_Digit6;
        (*TxData++) = K_Line_Set.No_Digit7;
        (*TxData++) = K_Line_Set.No_Digit8;
        (*TxData++) = K_Line_Set.No_Digit9;
        (*TxData++) = K_Line_Set.No_Digit10;
hu's avatar
hu committed
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
        Tx_Len = 12;
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}

/*-------------------------------------------------------------------------
* Function Name  : kwp_writeDataByLocalIdentifier
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 3B
--------------------------------------------------------------------------*/
unsigned char kwp_writeDataByLocalIdentifier(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
    unsigned char CupFlag = 0;
hu's avatar
hu committed
234

hu's avatar
hu committed
235
    if ((K_Line_Set.KLINE == 0) || ((K_Line_Set.KLINE == 1) && (K_LINE_SIGNAL_FLAG.SendSeedEQUSRecvSeed == 1)))
hu's avatar
hu committed
236
    {
hu's avatar
hu committed
237
        switch (RequestData[0]) /* */
hu's avatar
hu committed
238
        {
hu's avatar
hu committed
239
        case 0x20: /*应对ECE R13 0:非应对、1:应对*/
hu's avatar
hu committed
240 241 242 243
            K_Line_Set.K_Line_LID20 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x20;
            Tx_Len = 2;
hu's avatar
hu committed
244
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
245
            break;
hu's avatar
hu committed
246
        case 0x21: /*EBS/ABS 0:无、1:EBS、2:ABS(CAN应对) 3:ABS (CAN非应对)*/
hu's avatar
hu committed
247 248 249 250
            K_Line_Set.K_Line_LID21 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x21;
            Tx_Len = 2;
hu's avatar
hu committed
251
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
252
            break;
hu's avatar
hu committed
253
        case 0x22: /* EVSC 0:无、1:有 */
hu's avatar
hu committed
254 255 256 257
            K_Line_Set.K_Line_LID22 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x22;
            Tx_Len = 2;
hu's avatar
hu committed
258
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
259
            break;
hu's avatar
hu committed
260
        case 0x23: /* 驻车锁定 0:无、1:有*/
hu's avatar
hu committed
261 262 263 264
            K_Line_Set.K_Line_LID23 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x23;
            Tx_Len = 2;
hu's avatar
hu committed
265
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
266
            break;
hu's avatar
hu committed
267
        case 0x24: /* HSA */
hu's avatar
hu committed
268 269 270 271
            K_Line_Set.K_Line_LID24 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x24;
            Tx_Len = 2;
hu's avatar
hu committed
272
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
273
            break;
hu's avatar
hu committed
274
        case 0x25: /* AEBS */
hu's avatar
hu committed
275 276 277 278
            K_Line_Set.K_Line_LID25 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x25;
            Tx_Len = 2;
hu's avatar
hu committed
279
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
280
            break;
hu's avatar
hu committed
281
        case 0x26: /* ACC */
hu's avatar
hu committed
282 283 284 285
            K_Line_Set.K_Line_LID26 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x26;
            Tx_Len = 2;
hu's avatar
hu committed
286
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
287
            break;
hu's avatar
hu committed
288
        case 0x27: /* LDWS */
hu's avatar
hu committed
289 290 291 292
            K_Line_Set.K_Line_LID27 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x27;
            Tx_Len = 2;
hu's avatar
hu committed
293
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
294
            break;
hu's avatar
hu committed
295
        case 0x28: /* 车辆间报警 */
hu's avatar
hu committed
296 297 298 299
            K_Line_Set.K_Line_LID28 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x28;
            Tx_Len = 2;
hu's avatar
hu committed
300
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
301
            break;
hu's avatar
hu committed
302
        case 0x29: /* 有无巡航 */
hu's avatar
hu committed
303 304 305 306
            K_Line_Set.K_Line_LID29 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x29;
            Tx_Len = 2;
hu's avatar
hu committed
307
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
308
            break;
hu's avatar
hu committed
309
        case 0x2A: /* 气悬 */
hu's avatar
hu committed
310 311 312 313
            K_Line_Set.K_Line_LID2A = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2A;
            Tx_Len = 2;
hu's avatar
hu committed
314
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
315
            break;
hu's avatar
hu committed
316
        case 0x2B: /* ISS */
hu's avatar
hu committed
317 318 319 320
            K_Line_Set.K_Line_LID2B = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2B;
            Tx_Len = 2;
hu's avatar
hu committed
321
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
322
            break;
hu's avatar
hu committed
323
        case 0x2C: /* 装货台工作警报蜂鸣器 */
hu's avatar
hu committed
324 325 326 327
            K_Line_Set.K_Line_LID2C = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2C;
            Tx_Len = 2;
hu's avatar
hu committed
328
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
329
            break;
hu's avatar
hu committed
330
        case 0x2D: /* ROWS */
hu's avatar
hu committed
331 332 333 334
            K_Line_Set.K_Line_LID2D = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2D;
            Tx_Len = 2;
hu's avatar
hu committed
335
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
336
            break;
hu's avatar
hu committed
337
        case 0x2E: /* 行车记录仪*/
hu's avatar
hu committed
338 339 340 341
            K_Line_Set.K_Line_LID2E = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2E;
            Tx_Len = 2;
hu's avatar
hu committed
342
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
343
            break;
hu's avatar
hu committed
344
        case 0x2F: /* 车型 */
hu's avatar
hu committed
345 346 347 348
            K_Line_Set.K_Line_LID2F = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x2F;
            Tx_Len = 2;
hu's avatar
hu committed
349
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
350
            break;
hu's avatar
hu committed
351
        case 0x30: /* 缓速器 */
hu's avatar
hu committed
352 353 354 355
            K_Line_Set.K_Line_LID30 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x30;
            Tx_Len = 2;
hu's avatar
hu committed
356
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
357
            break;
hu's avatar
hu committed
358
        case 0x31: /* 地图巡航 */
hu's avatar
hu committed
359 360 361 362
            K_Line_Set.K_Line_LID31 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x31;
            Tx_Len = 2;
hu's avatar
hu committed
363
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
364
            break;
hu's avatar
hu committed
365
        case 0x32: /* 装货台种类 */
hu's avatar
hu committed
366 367 368 369
            K_Line_Set.K_Line_LID32 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x32;
            Tx_Len = 2;
hu's avatar
hu committed
370
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
371
            break;
hu's avatar
hu committed
372
        case 0x33: /* SCR?DPD */
hu's avatar
hu committed
373 374 375 376
            K_Line_Set.K_Line_LID33 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x33;
            Tx_Len = 2;
hu's avatar
hu committed
377
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
378
            break;
hu's avatar
hu committed
379
        case 0x34: /* 驻车种类 */
hu's avatar
hu committed
380 381 382 383
            K_Line_Set.K_Line_LID34 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x34;
            Tx_Len = 2;
hu's avatar
hu committed
384
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
385
            break;
hu's avatar
hu committed
386
        case 0x35: /* 气压计 */
hu's avatar
hu committed
387 388 389 390
            K_Line_Set.K_Line_LID35 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x35;
            Tx_Len = 2;
hu's avatar
hu committed
391
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
392
            break;
hu's avatar
hu committed
393
        case 0x36: /* 低气压报警 */
hu's avatar
hu committed
394 395 396 397
            K_Line_Set.K_Line_LID36 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x36;
            Tx_Len = 2;
hu's avatar
hu committed
398
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
399
            break;
hu's avatar
hu committed
400
        case 0x37: /* 超限警报 */
hu's avatar
hu committed
401 402 403 404
            K_Line_Set.K_Line_LID37 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x37;
            Tx_Len = 2;
hu's avatar
hu committed
405
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
406
            break;
hu's avatar
hu committed
407
        case 0x38: /* 速度警报 */
hu's avatar
hu committed
408 409 410 411
            K_Line_Set.K_Line_LID38 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x38;
            Tx_Len = 2;
hu's avatar
hu committed
412
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
413
            break;
hu's avatar
hu committed
414
        case 0x39: /* 可变SLD */
hu's avatar
hu committed
415 416 417 418
            K_Line_Set.K_Line_LID39 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x39;
            Tx_Len = 2;
hu's avatar
hu committed
419
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
420
            break;
hu's avatar
hu committed
421
        case 0x3A: /* OEM */
hu's avatar
hu committed
422 423 424 425
            K_Line_Set.K_Line_LID3A = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3A;
            Tx_Len = 2;
hu's avatar
hu committed
426
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
427
            break;
hu's avatar
hu committed
428
        case 0x3B: /*预留 */
hu's avatar
hu committed
429 430 431 432
            K_Line_Set.K_Line_LID3B = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3B;
            Tx_Len = 2;
hu's avatar
hu committed
433
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
434
            break;
hu's avatar
hu committed
435
        case 0x3C: /* 预留 */
hu's avatar
hu committed
436 437 438 439
            K_Line_Set.K_Line_LID3C = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3C;
            Tx_Len = 2;
hu's avatar
hu committed
440
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
441
            break;
hu's avatar
hu committed
442
        case 0x3D: /* 预留 */
hu's avatar
hu committed
443 444 445 446
            K_Line_Set.K_Line_LID3D = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3D;
            Tx_Len = 2;
hu's avatar
hu committed
447
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
448
            break;
hu's avatar
hu committed
449
        case 0x3E: /* 预留 */
hu's avatar
hu committed
450 451 452 453
            K_Line_Set.K_Line_LID3E = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3E;
            Tx_Len = 2;
hu's avatar
hu committed
454
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
455
            break;
hu's avatar
hu committed
456
        case 0x3F: /* 预留 */
hu's avatar
hu committed
457 458 459 460
            K_Line_Set.K_Line_LID3F = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x3F;
            Tx_Len = 2;
hu's avatar
hu committed
461
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
462
            break;
hu's avatar
hu committed
463
        case 0x40: /* 发动机种类名称 */
hu's avatar
hu committed
464 465 466 467
            K_Line_Set.K_Line_LID40 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x40;
            Tx_Len = 2;
hu's avatar
hu committed
468
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
469
            break;
hu's avatar
hu committed
470
        case 0x41: /* 变速器种类&控制 */
hu's avatar
hu committed
471 472 473 474
            K_Line_Set.K_Line_LID41 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x41;
            Tx_Len = 2;
hu's avatar
hu committed
475
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
476
            break;
hu's avatar
hu committed
477
        case 0x42: /* 驻车管道 */
hu's avatar
hu committed
478 479 480 481
            K_Line_Set.K_Line_LID42 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x42;
            Tx_Len = 2;
hu's avatar
hu committed
482
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
483
            break;
hu's avatar
hu committed
484
        case 0x43: /* 车型 */
hu's avatar
hu committed
485 486 487 488
            K_Line_Set.K_Line_LID43 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x43;
            Tx_Len = 2;
hu's avatar
hu committed
489
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
490
            break;
hu's avatar
hu committed
491
        case 0x44: /* 速度警报 */
hu's avatar
hu committed
492 493 494 495
            K_Line_Set.K_Line_LID44 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x44;
            Tx_Len = 2;
hu's avatar
hu committed
496
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
497
            break;
hu's avatar
hu committed
498
        case 0x45: /* 发动机转速 */
hu's avatar
hu committed
499 500 501 502 503
            K_Line_Set.K_Line_LID45 = RequestData[2];
            User_App.User_Speed = K_Line_Set.K_Line_LID45;
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x45;
            Tx_Len = 2;
hu's avatar
hu committed
504
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
505
            break;
hu's avatar
hu committed
506
        case 0x46: /* 急加速 */
hu's avatar
hu committed
507 508 509 510 511
            K_Line_Set.K_Line_LID46 = RequestData[2];
            User_App.User_JADD = K_Line_Set.K_Line_LID46;
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x46;
            Tx_Len = 2;
hu's avatar
hu committed
512
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
513
            break;
hu's avatar
hu committed
514
        case 0x47: /* 急减速 */
hu's avatar
hu committed
515 516 517 518 519
            K_Line_Set.K_Line_LID47 = RequestData[2];
            User_App.User_JSUB = K_Line_Set.K_Line_LID47;
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x47;
            Tx_Len = 2;
hu's avatar
hu committed
520
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
521
            break;
hu's avatar
hu committed
522
        case 0x48: /* 长时间怠速 */
hu's avatar
hu committed
523 524 525 526
            K_Line_Set.K_Line_LID48 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x48;
            Tx_Len = 2;
hu's avatar
hu committed
527
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
528
            break;
hu's avatar
hu committed
529
        case 0x49: /* 辅助驻车 */
hu's avatar
hu committed
530 531 532 533
            K_Line_Set.K_Line_LID49 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x49;
            Tx_Len = 2;
hu's avatar
hu committed
534
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
535
            break;
hu's avatar
hu committed
536
        case 0x4A: /* 变速箱油 */
hu's avatar
hu committed
537 538 539 540
            K_Line_Set.K_Line_LID4A = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4A;
            Tx_Len = 2;
hu's avatar
hu committed
541
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
542
            break;
hu's avatar
hu committed
543
        case 0x4B: /* 差速器油 */
hu's avatar
hu committed
544 545 546 547
            K_Line_Set.K_Line_LID4B = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4B;
            Tx_Len = 2;
hu's avatar
hu committed
548
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
549
            break;
hu's avatar
hu committed
550
        case 0x4C: /* 离合器油 */
hu's avatar
hu committed
551 552 553 554
            K_Line_Set.K_Line_LID4C = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4C;
            Tx_Len = 2;
hu's avatar
hu committed
555
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
556
            break;
hu's avatar
hu committed
557
        case 0x4D: /* 动力转向油 */
hu's avatar
hu committed
558 559 560 561
            K_Line_Set.K_Line_LID4D = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4D;
            Tx_Len = 2;
hu's avatar
hu committed
562
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
563
            break;
hu's avatar
hu committed
564
        case 0x4E: /* 轮胎 */
hu's avatar
hu committed
565 566 567 568
            K_Line_Set.K_Line_LID4E = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4E;
            Tx_Len = 2;
hu's avatar
hu committed
569
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
570
            break;
hu's avatar
hu committed
571
        case 0x4F: /* 机油&滤清器 */
hu's avatar
hu committed
572 573 574 575
            K_Line_Set.K_Line_LID4F = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x4F;
            Tx_Len = 2;
hu's avatar
hu committed
576
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
577
            break;
hu's avatar
hu committed
578
        case 0x50: /* 预留 */
hu's avatar
hu committed
579 580 581 582
            K_Line_Set.K_Line_LID50 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x50;
            Tx_Len = 2;
hu's avatar
hu committed
583
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
584
            break;
hu's avatar
hu committed
585
        case 0x51: /* 工作模式 */
hu's avatar
hu committed
586 587 588 589
            K_Line_Set.K_Line_LID51 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x51;
            Tx_Len = 2;
hu's avatar
hu committed
590
            //DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
591
            break;
hu's avatar
hu committed
592
        case 0x52: /* 电子部件设定 */
hu's avatar
hu committed
593 594 595 596
            K_Line_Set.K_Line_LID52 = RequestData[2];
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x52;
            Tx_Len = 2;
hu's avatar
hu committed
597
            DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
598 599
            break;

hu's avatar
hu committed
600
        case 0x91: /*  */
hu's avatar
hu committed
601 602 603 604 605 606 607 608 609 610
            K_Line_Set.No_Digit1 = RequestData[1];
            K_Line_Set.No_Digit2 = RequestData[2];
            K_Line_Set.No_Digit3 = RequestData[3];
            K_Line_Set.No_Digit4 = RequestData[4];
            K_Line_Set.No_Digit5 = RequestData[5];
            K_Line_Set.No_Digit6 = RequestData[6];
            K_Line_Set.No_Digit7 = RequestData[7];
            K_Line_Set.No_Digit8 = RequestData[8];
            K_Line_Set.No_Digit9 = RequestData[9];
            K_Line_Set.No_Digit10 = RequestData[10];
hu's avatar
hu committed
611

hu's avatar
hu committed
612
            /*写EEP*/
hu's avatar
hu committed
613
            DTCstatusCHGFFK_Line = 1;   //----ECU ID_ECU件号 eep
hu's avatar
hu committed
614 615 616 617 618

            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = RequestData[0];
            Tx_Len = 2;
            break;
hu's avatar
hu committed
619
        case 0xA0: /*  */
hu's avatar
hu committed
620
            K_Line_Set.TesterECU = RequestData[2];
hu's avatar
hu committed
621

hu's avatar
hu committed
622
            if (K_Line_Set.METERCOUNT < 0xFF)
hu's avatar
hu committed
623
            {
hu's avatar
hu committed
624
                K_Line_Set.METERCOUNT++; /*修正率次数增加*/
hu's avatar
hu committed
625 626 627
            }
            else
            {
hu's avatar
hu committed
628
                K_Line_Set.METERCOUNT = 0xFF; /*修正率次数增加*/
hu's avatar
hu committed
629 630
            }

hu's avatar
hu committed
631 632
            DTCstatusCHGFFK_Line = 1;

hu's avatar
hu committed
633 634 635 636
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0xA0;
            Tx_Len = 2;
            break;
hu's avatar
hu committed
637
        case 0xA3: /*  */
hu's avatar
hu committed
638
            K_Line_Set.TesterECUCAN = RequestData[2];
hu's avatar
hu committed
639

hu's avatar
hu committed
640
            if (K_Line_Set.METERCOUNT < 0xFF)
hu's avatar
hu committed
641
            {
hu's avatar
hu committed
642
                K_Line_Set.METERCOUNT++; /*修正率次数增加*/
hu's avatar
hu committed
643 644 645
            }
            else
            {
hu's avatar
hu committed
646
                K_Line_Set.METERCOUNT = 0xFF; /*修正率次数增加*/
hu's avatar
hu committed
647 648
            }

hu's avatar
hu committed
649 650
            DTCstatusCHGFFK_Line = 1;

hu's avatar
hu committed
651 652 653 654 655 656 657 658 659 660 661 662
            (*TxData++) = KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0xA3;
            Tx_Len = 2;
            break;
        default: /* subFunctionNotSupported */
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
            break;
        }
        return Tx_Len;
    }
    else
    {
hu's avatar
hu committed
663
        if ((K_Line_Set.KLINE == 1u) && (K_LINE_SIGNAL_FLAG.SendSeedEQUSRecvSeed == 0u))
hu's avatar
hu committed
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686
        {
            if (((RequestData[0] >= 0x20) && (RequestData[0] <= 0x52)) || (RequestData[0] == 0x91) || (RequestData[0] == 0xA0) || (RequestData[0] == 0xA3))
                Kwp2000_Negative.ResponseCode = KWP2000_securityAccessDenied;
            else
                Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        }
        else
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        return Tx_Len;
    }
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readDataByLocalIdentifier
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 21
--------------------------------------------------------------------------*/
unsigned char kwp_readDataByLocalIdentifier(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
    unsigned int ECUStatusCup = 0;
hu's avatar
hu committed
687

hu's avatar
hu committed
688
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
689
    {
hu's avatar
hu committed
690
    case 0x20: /* 应对ECE R13 */
hu's avatar
hu committed
691 692 693
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x20;
        (*TxData++) = 0x00;
hu's avatar
hu committed
694
        (*TxData++) = K_Line_Set.K_Line_LID20;
hu's avatar
hu committed
695 696
        Tx_Len = 4;
        break;
hu's avatar
hu committed
697
    case 0x21: /* EBS/ABS */
hu's avatar
hu committed
698 699 700
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x21;
        (*TxData++) = 0x00;
hu's avatar
hu committed
701
        (*TxData++) = K_Line_Set.K_Line_LID21;
hu's avatar
hu committed
702 703
        Tx_Len = 4;
        break;
hu's avatar
hu committed
704
    case 0x22: /* EVSC */
hu's avatar
hu committed
705 706 707
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x22;
        (*TxData++) = 0x00;
hu's avatar
hu committed
708
        (*TxData++) = K_Line_Set.K_Line_LID22;
hu's avatar
hu committed
709 710
        Tx_Len = 4;
        break;
hu's avatar
hu committed
711
    case 0x23: /* 驻车锁定 */
hu's avatar
hu committed
712 713 714
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x23;
        (*TxData++) = 0x00;
hu's avatar
hu committed
715
        (*TxData++) = K_Line_Set.K_Line_LID23;
hu's avatar
hu committed
716 717
        Tx_Len = 4;
        break;
hu's avatar
hu committed
718
    case 0x24: /* HSA */
hu's avatar
hu committed
719 720 721
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x24;
        (*TxData++) = 0x00;
hu's avatar
hu committed
722
        (*TxData++) = K_Line_Set.K_Line_LID24;
hu's avatar
hu committed
723 724
        Tx_Len = 4;
        break;
hu's avatar
hu committed
725
    case 0x25: /* AEBS */
hu's avatar
hu committed
726 727 728
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x25;
        (*TxData++) = 0x00;
hu's avatar
hu committed
729
        (*TxData++) = K_Line_Set.K_Line_LID25;
hu's avatar
hu committed
730 731
        Tx_Len = 4;
        break;
hu's avatar
hu committed
732
    case 0x26: /* ACC */
hu's avatar
hu committed
733 734 735
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x26;
        (*TxData++) = 0x00;
hu's avatar
hu committed
736
        (*TxData++) = K_Line_Set.K_Line_LID26;
hu's avatar
hu committed
737 738
        Tx_Len = 4;
        break;
hu's avatar
hu committed
739
    case 0x27: /* LDWS */
hu's avatar
hu committed
740 741 742
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x27;
        (*TxData++) = 0x00;
hu's avatar
hu committed
743
        (*TxData++) = K_Line_Set.K_Line_LID27;
hu's avatar
hu committed
744 745
        Tx_Len = 4;
        break;
hu's avatar
hu committed
746
    case 0x28: /* 车辆间报警 */
hu's avatar
hu committed
747 748 749
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x28;
        (*TxData++) = 0x00;
hu's avatar
hu committed
750
        (*TxData++) = K_Line_Set.K_Line_LID28;
hu's avatar
hu committed
751 752
        Tx_Len = 4;
        break;
hu's avatar
hu committed
753
    case 0x29: /* 有无巡航 */
hu's avatar
hu committed
754 755 756
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x29;
        (*TxData++) = 0x00;
hu's avatar
hu committed
757
        (*TxData++) = K_Line_Set.K_Line_LID29;
hu's avatar
hu committed
758 759
        Tx_Len = 4;
        break;
hu's avatar
hu committed
760
    case 0x2A: /* 气悬 */
hu's avatar
hu committed
761 762 763
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2A;
        (*TxData++) = 0x00;
hu's avatar
hu committed
764
        (*TxData++) = K_Line_Set.K_Line_LID2A;
hu's avatar
hu committed
765 766
        Tx_Len = 4;
        break;
hu's avatar
hu committed
767
    case 0x2B: /* ISS */
hu's avatar
hu committed
768 769 770
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2B;
        (*TxData++) = 0x00;
hu's avatar
hu committed
771
        (*TxData++) = K_Line_Set.K_Line_LID2B;
hu's avatar
hu committed
772 773
        Tx_Len = 4;
        break;
hu's avatar
hu committed
774
    case 0x2C: /* װ装货台工作警报蜂鸣器 */
hu's avatar
hu committed
775 776 777
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2C;
        (*TxData++) = 0x00;
hu's avatar
hu committed
778
        (*TxData++) = K_Line_Set.K_Line_LID2C;
hu's avatar
hu committed
779 780
        Tx_Len = 4;
        break;
hu's avatar
hu committed
781
    case 0x2D: /* ROWS */
hu's avatar
hu committed
782 783 784
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2D;
        (*TxData++) = 0x00;
hu's avatar
hu committed
785
        (*TxData++) = K_Line_Set.K_Line_LID2D;
hu's avatar
hu committed
786 787
        Tx_Len = 4;
        break;
hu's avatar
hu committed
788
    case 0x2E: /* 行车记录仪 */
hu's avatar
hu committed
789 790 791
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2E;
        (*TxData++) = 0x00;
hu's avatar
hu committed
792
        (*TxData++) = K_Line_Set.K_Line_LID2E;
hu's avatar
hu committed
793 794
        Tx_Len = 4;
        break;
hu's avatar
hu committed
795
    case 0x2F: /* 车型 */
hu's avatar
hu committed
796 797 798
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x2F;
        (*TxData++) = 0x00;
hu's avatar
hu committed
799
        (*TxData++) = K_Line_Set.K_Line_LID2F;
hu's avatar
hu committed
800 801
        Tx_Len = 4;
        break;
hu's avatar
hu committed
802
    case 0x30: /* 缓速器 */
hu's avatar
hu committed
803 804 805
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x30;
        (*TxData++) = 0x00;
hu's avatar
hu committed
806
        (*TxData++) = K_Line_Set.K_Line_LID30;
hu's avatar
hu committed
807 808
        Tx_Len = 4;
        break;
hu's avatar
hu committed
809
    case 0x31: /* 地图巡航 */
hu's avatar
hu committed
810 811 812
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x31;
        (*TxData++) = 0x00;
hu's avatar
hu committed
813
        (*TxData++) = K_Line_Set.K_Line_LID31;
hu's avatar
hu committed
814 815
        Tx_Len = 4;
        break;
hu's avatar
hu committed
816
    case 0x32: /* 装货台种类 */
hu's avatar
hu committed
817 818 819
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x32;
        (*TxData++) = 0x00;
hu's avatar
hu committed
820
        (*TxData++) = K_Line_Set.K_Line_LID32;
hu's avatar
hu committed
821 822
        Tx_Len = 4;
        break;
hu's avatar
hu committed
823
    case 0x33: /*  SCR?DPD */
hu's avatar
hu committed
824 825 826
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x33;
        (*TxData++) = 0x00;
hu's avatar
hu committed
827
        (*TxData++) = K_Line_Set.K_Line_LID33;
hu's avatar
hu committed
828 829
        Tx_Len = 4;
        break;
hu's avatar
hu committed
830
    case 0x34: /* 驻车种类 */
hu's avatar
hu committed
831 832 833
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x34;
        (*TxData++) = 0x00;
hu's avatar
hu committed
834
        (*TxData++) = K_Line_Set.K_Line_LID34;
hu's avatar
hu committed
835 836
        Tx_Len = 4;
        break;
hu's avatar
hu committed
837
    case 0x35: /* 气压计 */
hu's avatar
hu committed
838 839 840
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x35;
        (*TxData++) = 0x00;
hu's avatar
hu committed
841
        (*TxData++) = K_Line_Set.K_Line_LID35;
hu's avatar
hu committed
842 843
        Tx_Len = 4;
        break;
hu's avatar
hu committed
844
    case 0x36: /* 低压警报 */
hu's avatar
hu committed
845 846 847
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x36;
        (*TxData++) = 0x00;
hu's avatar
hu committed
848
        (*TxData++) = K_Line_Set.K_Line_LID36;
hu's avatar
hu committed
849 850
        Tx_Len = 4;
        break;
hu's avatar
hu committed
851
    case 0x37: /* 超限警报 */
hu's avatar
hu committed
852 853 854
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x37;
        (*TxData++) = 0x00;
hu's avatar
hu committed
855
        (*TxData++) = K_Line_Set.K_Line_LID37;
hu's avatar
hu committed
856 857
        Tx_Len = 4;
        break;
hu's avatar
hu committed
858
    case 0x38: /* 速度警报 */
hu's avatar
hu committed
859 860 861
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x38;
        (*TxData++) = 0x00;
hu's avatar
hu committed
862
        (*TxData++) = K_Line_Set.K_Line_LID38;
hu's avatar
hu committed
863 864
        Tx_Len = 4;
        break;
hu's avatar
hu committed
865
    case 0x39: /* 可变SLD */
hu's avatar
hu committed
866 867 868
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x39;
        (*TxData++) = 0x00;
hu's avatar
hu committed
869
        (*TxData++) = K_Line_Set.K_Line_LID39;
hu's avatar
hu committed
870 871
        Tx_Len = 4;
        break;
hu's avatar
hu committed
872
    case 0x3A: /* OEM */
hu's avatar
hu committed
873 874 875
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3A;
        (*TxData++) = 0x00;
hu's avatar
hu committed
876
        (*TxData++) = K_Line_Set.K_Line_LID3A;
hu's avatar
hu committed
877 878
        Tx_Len = 4;
        break;
hu's avatar
hu committed
879
    case 0x3B: /*  */
hu's avatar
hu committed
880 881 882
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3B;
        (*TxData++) = 0x00;
hu's avatar
hu committed
883
        (*TxData++) = K_Line_Set.K_Line_LID3B;
hu's avatar
hu committed
884 885
        Tx_Len = 4;
        break;
hu's avatar
hu committed
886
    case 0x3C: /*  */
hu's avatar
hu committed
887 888 889
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3C;
        (*TxData++) = 0x00;
hu's avatar
hu committed
890
        (*TxData++) = K_Line_Set.K_Line_LID3C;
hu's avatar
hu committed
891 892
        Tx_Len = 4;
        break;
hu's avatar
hu committed
893
    case 0x3D: /*  */
hu's avatar
hu committed
894 895 896
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3D;
        (*TxData++) = 0x00;
hu's avatar
hu committed
897
        (*TxData++) = K_Line_Set.K_Line_LID3D;
hu's avatar
hu committed
898 899
        Tx_Len = 4;
        break;
hu's avatar
hu committed
900
    case 0x3E: /*  */
hu's avatar
hu committed
901 902 903
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3E;
        (*TxData++) = 0x00;
hu's avatar
hu committed
904
        (*TxData++) = K_Line_Set.K_Line_LID3E;
hu's avatar
hu committed
905 906
        Tx_Len = 4;
        break;
hu's avatar
hu committed
907
    case 0x3F: /*  */
hu's avatar
hu committed
908 909 910
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x3F;
        (*TxData++) = 0x00;
hu's avatar
hu committed
911
        (*TxData++) = K_Line_Set.K_Line_LID3F;
hu's avatar
hu committed
912 913
        Tx_Len = 4;
        break;
hu's avatar
hu committed
914
    case 0x40: /* 发动机种类 */
hu's avatar
hu committed
915 916 917
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x40;
        (*TxData++) = 0x00;
hu's avatar
hu committed
918
        (*TxData++) = K_Line_Set.K_Line_LID40;
hu's avatar
hu committed
919 920
        Tx_Len = 4;
        break;
hu's avatar
hu committed
921
    case 0x41: /* 变速器种类&控制 */
hu's avatar
hu committed
922 923 924
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x41;
        (*TxData++) = 0x00;
hu's avatar
hu committed
925
        (*TxData++) = K_Line_Set.K_Line_LID41;
hu's avatar
hu committed
926 927
        Tx_Len = 4;
        break;
hu's avatar
hu committed
928
    case 0x42: /* 5.2.14.1.4.  驻车管道*/
hu's avatar
hu committed
929 930 931
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x42;
        (*TxData++) = 0x00;
hu's avatar
hu committed
932
        (*TxData++) = K_Line_Set.K_Line_LID42;
hu's avatar
hu committed
933 934
        Tx_Len = 4;
        break;
hu's avatar
hu committed
935
    case 0x43: /* 5.2.14.1.5.  车型 */
hu's avatar
hu committed
936 937 938
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x43;
        (*TxData++) = 0x00;
hu's avatar
hu committed
939
        (*TxData++) = K_Line_Set.K_Line_LID43;
hu's avatar
hu committed
940 941
        Tx_Len = 4;
        break;
hu's avatar
hu committed
942
    case 0x44: /* 速度警报 */
hu's avatar
hu committed
943 944 945
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x44;
        (*TxData++) = 0x00;
hu's avatar
hu committed
946
        (*TxData++) = K_Line_Set.K_Line_LID44;
hu's avatar
hu committed
947 948
        Tx_Len = 4;
        break;
hu's avatar
hu committed
949
    case 0x45: /* 发动机转速 */
hu's avatar
hu committed
950 951 952
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x45;
        (*TxData++) = 0x00;
hu's avatar
hu committed
953
        (*TxData++) = K_Line_Set.K_Line_LID45;
hu's avatar
hu committed
954 955
        Tx_Len = 4;
        break;
hu's avatar
hu committed
956
    case 0x46: /* 急加速 */
hu's avatar
hu committed
957 958 959
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x46;
        (*TxData++) = 0x00;
hu's avatar
hu committed
960
        (*TxData++) = K_Line_Set.K_Line_LID46;
hu's avatar
hu committed
961 962
        Tx_Len = 4;
        break;
hu's avatar
hu committed
963
    case 0x47: /* 急减速 */
hu's avatar
hu committed
964 965 966
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x47;
        (*TxData++) = 0x00;
hu's avatar
hu committed
967
        (*TxData++) = K_Line_Set.K_Line_LID47;
hu's avatar
hu committed
968 969
        Tx_Len = 4;
        break;
hu's avatar
hu committed
970
    case 0x48: /* 长时间怠速 */
hu's avatar
hu committed
971 972 973
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x48;
        (*TxData++) = 0x00;
hu's avatar
hu committed
974
        (*TxData++) = K_Line_Set.K_Line_LID48;
hu's avatar
hu committed
975 976
        Tx_Len = 4;
        break;
hu's avatar
hu committed
977
    case 0x49: /* 辅助驻车 */
hu's avatar
hu committed
978 979 980
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x49;
        (*TxData++) = 0x00;
hu's avatar
hu committed
981
        (*TxData++) = K_Line_Set.K_Line_LID49;
hu's avatar
hu committed
982 983
        Tx_Len = 4;
        break;
hu's avatar
hu committed
984
    case 0x4A: /* 变速箱油 */
hu's avatar
hu committed
985 986 987
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4A;
        (*TxData++) = 0x00;
hu's avatar
hu committed
988
        (*TxData++) = K_Line_Set.K_Line_LID4A;
hu's avatar
hu committed
989 990
        Tx_Len = 4;
        break;
hu's avatar
hu committed
991
    case 0x4B: /* 差速器油 */
hu's avatar
hu committed
992 993 994
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4B;
        (*TxData++) = 0x00;
hu's avatar
hu committed
995
        (*TxData++) = K_Line_Set.K_Line_LID4B;
hu's avatar
hu committed
996 997
        Tx_Len = 4;
        break;
hu's avatar
hu committed
998
    case 0x4C: /* 离合器油 */
hu's avatar
hu committed
999 1000 1001
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4C;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1002
        (*TxData++) = K_Line_Set.K_Line_LID4C;
hu's avatar
hu committed
1003 1004
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1005
    case 0x4D: /* 动力转向油 */
hu's avatar
hu committed
1006 1007 1008
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4D;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1009
        (*TxData++) = K_Line_Set.K_Line_LID4D;
hu's avatar
hu committed
1010 1011
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1012
    case 0x4E: /* 轮胎 */
hu's avatar
hu committed
1013 1014 1015
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4E;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1016
        (*TxData++) = K_Line_Set.K_Line_LID4E;
hu's avatar
hu committed
1017 1018
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1019
    case 0x4F: /* 机油&滤清器 */
hu's avatar
hu committed
1020 1021 1022
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x4F;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1023
        (*TxData++) = K_Line_Set.K_Line_LID4F;
hu's avatar
hu committed
1024 1025
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1026
    case 0x50: /* 预留 */
hu's avatar
hu committed
1027 1028 1029
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x50;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1030
        (*TxData++) = K_Line_Set.K_Line_LID50;
hu's avatar
hu committed
1031 1032
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1033
    case 0x51: /* 5.2.14.1.8.  工作模式 */
hu's avatar
hu committed
1034 1035 1036
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x51;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1037
        (*TxData++) = K_Line_Set.K_Line_LID51;
hu's avatar
hu committed
1038 1039
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1040
    case 0x52: /* 5.2.14.1.9.  电子部件设定 */
hu's avatar
hu committed
1041 1042 1043
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x52;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1044
        (*TxData++) = K_Line_Set.K_Line_LID52;
hu's avatar
hu committed
1045 1046 1047
        Tx_Len = 4;
        break;

hu's avatar
hu committed
1048
    case 0xA0: /*  */
hu's avatar
hu committed
1049 1050 1051
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0xA0;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1052
        (*TxData++) = K_Line_Set.TesterECU;
hu's avatar
hu committed
1053 1054
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1055
    case 0xA3: /*  */
hu's avatar
hu committed
1056 1057 1058
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0xA3;
        (*TxData++) = 0x00;
hu's avatar
hu committed
1059
        (*TxData++) = K_Line_Set.TesterECUCAN;
hu's avatar
hu committed
1060 1061
        Tx_Len = 4;
        break;
hu's avatar
hu committed
1062
    case 0xA1: /*  */
hu's avatar
hu committed
1063
    /*
hu's avatar
hu committed
1064
    K_Line_Set.ECUStatus1 = ECUStatusONE.Data[0];
hu's avatar
hu committed
1065 1066

    if (DataVSpeedDisp <= 1275)
hu's avatar
hu committed
1067
        K_Line_Set.ECUStatus2 = DataVSpeedDisp / 5 ;
hu's avatar
hu committed
1068 1069

    ECUStatusCup = ECUSTATUST_F ;
hu's avatar
hu committed
1070 1071
    K_Line_Set.ECUStatus3 = (unsigned char)(ECUStatusCup & 0xFF);
    K_Line_Set.ECUStatus4 = (unsigned char)((ECUStatusCup >> 8) & 0xFF);
hu's avatar
hu committed
1072

hu's avatar
hu committed
1073
    K_Line_Set.ECUStatus5 = 0x80;
hu's avatar
hu committed
1074 1075 1076

    (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
    (*TxData++) = 0xA1;
hu's avatar
hu committed
1077 1078 1079 1080 1081
    (*TxData++) = K_Line_Set.ECUStatus1;
    (*TxData++) = K_Line_Set.ECUStatus2;
    (*TxData++) = K_Line_Set.ECUStatus3;
    (*TxData++) = K_Line_Set.ECUStatus4;
    (*TxData++) = K_Line_Set.ECUStatus5;
hu's avatar
hu committed
1082 1083 1084
    Tx_Len = 7;
    break;
    */
hu's avatar
hu committed
1085
    case 0xA2: /*  */
hu's avatar
hu committed
1086 1087
        (*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0xA2;
hu's avatar
hu committed
1088
        (*TxData++) = K_Line_Set.METERCOUNT; /*修正率替换次数*/
hu's avatar
hu committed
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
        Tx_Len = 3;
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readDataByCommonIdentifier
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 22
--------------------------------------------------------------------------*/
unsigned char kwp_readDataByCommonIdentifier(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
1108

hu's avatar
hu committed
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readDataAccessMode
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 27
--------------------------------------------------------------------------*/
unsigned char kwp_readDataAccessMode(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned long SeedKey = 0;
    unsigned char Tx_Len = 0;

hu's avatar
hu committed
1124
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
1125
    {
hu's avatar
hu committed
1126
    case 0x01: /*  */
hu's avatar
hu committed
1127
        if (K_Line_Set.KLINE == 1)/*是否锁定标记*/
hu's avatar
hu committed
1128
        {
hu's avatar
hu committed
1129
            /*密钥随机数生成*/
hu's avatar
hu committed
1130 1131 1132 1133
            EOLSeedRandomNumber = EOLSeedRandomNumber * 1024 + 520;
            SeedKey = (unsigned long)EOLSeedRandomNumber;
            SeedKey = SeedKey << 16;
            SeedKey |= (unsigned long)(~EOLSeedRandomNumber);
hu's avatar
hu committed
1134 1135 1136 1137 1138

            Seed1 = (unsigned char)(SeedKey >> 24);
            Seed2 = (unsigned char)(SeedKey >> 16);
            Seed3 = (unsigned char)(SeedKey >> 8);
            Seed4 = (unsigned char)(SeedKey);
hu's avatar
hu committed
1139 1140 1141

            /*计算密钥等待应答*/
            App_Uds_Calc_Key();
hu's avatar
hu committed
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159

            K_LINE_SIGNAL_FLAG.AccessMode2701 = 1;
            AccessMode2701KeyTime = 0;
            AccessMode2701KeyTimeFlag = 1;

            (*TxData++) = KWP2000_SECURITYACCESS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x01;
            (*TxData++) = Seed1;
            (*TxData++) = Seed2;
            (*TxData++) = Seed3;
            (*TxData++) = Seed4;
            Tx_Len = 6;
        }
        else
        {
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        }
        break;
hu's avatar
hu committed
1160 1161 1162 1163 1164
    case 0x02: /*  */
        Recvseed1 = RequestData[1];
        Recvseed2 = RequestData[2];
        Recvseed3 = RequestData[3];
        Recvseed4 = RequestData[4];
hu's avatar
hu committed
1165
        if (
hu's avatar
hu committed
1166 1167 1168 1169 1170
            (Sendseed1 == Recvseed1) &&
            (Sendseed2 == Recvseed2) &&
            (Sendseed3 == Recvseed3) &&
            (Sendseed4 == Recvseed4) &&
            (AccessMode2701KeyTimeFlag == 1))
hu's avatar
hu committed
1171
        {
hu's avatar
hu committed
1172
            K_LINE_SIGNAL_FLAG.AccessMode2701 = 0;
hu's avatar
hu committed
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203
            AccessMode2701KeyTimeFlag = 1;

            K_LINE_SIGNAL_FLAG.SendSeedEQUSRecvSeed = 1;
            (*TxData++) = KWP2000_SECURITYACCESS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0x02;
            Tx_Len = 2;
        }
        else
        {
            K_LINE_SIGNAL_FLAG.SendSeedEQUSRecvSeed = 0;
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        }
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }

    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readDataAccessMode
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 31
--------------------------------------------------------------------------*/
unsigned char kwp_StartroutInebykocalIdentifier(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
1204

hu's avatar
hu committed
1205
    switch (RequestData[0]) /*  */
hu's avatar
hu committed
1206
    {
hu's avatar
hu committed
1207
    case 0x08: /*  */
hu's avatar
hu committed
1208 1209
        K_LINE_SIGNAL_FLAG.S_Regist = 1;
        K_Line_Set.KLINE = 1 ;
hu's avatar
hu committed
1210
        /*写EEP*/
hu's avatar
hu committed
1211
        DTCstatusCHGFFK_Line = 1;
hu's avatar
hu committed
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232
        (*TxData++) = KWP2000_STARTROUTINEBYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
        (*TxData++) = 0x08;
        Tx_Len = 2;
        break;
    default: /*  */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_readDataStatusofDTC
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 18
--------------------------------------------------------------------------*/
unsigned char kwp_readDataStatusofDTC(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
1233

hu's avatar
hu committed
1234
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
1235
    {
hu's avatar
hu committed
1236
    case 0x00: /*  */
hu's avatar
hu committed
1237 1238 1239 1240
    /*
    if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1241
      (*TxData++) = K_Line_Set.NoOfDTCFF00;
hu's avatar
hu committed
1242 1243 1244 1245 1246
      Tx_Len = 2;
    }
    else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1247
      (*TxData++) = K_Line_Set.NoOfDTC8000;
hu's avatar
hu committed
1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260
      Tx_Len = 2;
    }
    else
    {
      Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
    }
    break;
    */
    case 0x01:
    /*
    if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1261
      (*TxData++) = K_Line_Set.NoOfDTCFF01;
hu's avatar
hu committed
1262 1263 1264 1265 1266
      Tx_Len = 2;
    }
    else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1267
      (*TxData++) = K_Line_Set.NoOfDTC8001;
hu's avatar
hu committed
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280
      Tx_Len = 2;
    }
    else
    {
      Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
    }
    break;
    */
    case 0x02:
    /*
    if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1281
      (*TxData++) = K_Line_Set.NoOfDTCFF02;
hu's avatar
hu committed
1282 1283 1284 1285 1286
      Tx_Len = 2;
    }
    else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
    {
      (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1287
      (*TxData++) = K_Line_Set.NoOfDTC8002;
hu's avatar
hu committed
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299
      Tx_Len = 2;
    }
    else
    {
      Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
    }
    break;
    */
    case 0x03:
        if ((RequestData[1] == 0xFF) && (RequestData[2] == 0x00))
        {
            (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1300
            (*TxData++) = K_Line_Set.NoOfDTCFF00;
hu's avatar
hu committed
1301 1302 1303 1304 1305
            Tx_Len = 2;
        }
        else if ((RequestData[1] == 0x80) && (RequestData[2] == 0x00))
        {
            (*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
hu's avatar
hu committed
1306
            (*TxData++) = K_Line_Set.NoOfDTC8000;
hu's avatar
hu committed
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330
            Tx_Len = 2;
        }
        else
        {
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        }
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : kwp_ClearDiagnosticInformation
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         : 14
--------------------------------------------------------------------------*/
unsigned char kwp_ClearDiagnosticInformation(unsigned char *TxData, unsigned char *RequestData)
{
    unsigned char Tx_Len = 0;
hu's avatar
hu committed
1331

hu's avatar
hu committed
1332
    switch (RequestData[0]) /* subFunction */
hu's avatar
hu committed
1333
    {
hu's avatar
hu committed
1334
    case 0xFF: /*  */
hu's avatar
hu committed
1335 1336 1337 1338 1339
        if (RequestData[1] == 0x00)
        {
            (*TxData++) = KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
            (*TxData++) = 0xFF;
            (*TxData++) = 0x00;
hu's avatar
hu committed
1340
            // K_Line_Set.NoOfDTCFF00 == 0x00;
hu's avatar
hu committed
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363
            Tx_Len = 3;
        }
        else
        {
            Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        }
        break;
    default: /* subFunctionNotSupported */
        Kwp2000_Negative.ResponseCode = KWP2000_subFunctionNotSupported;
        break;
    }
    return Tx_Len;
}
/*-------------------------------------------------------------------------
* Function Name  : App_Uds_Calc_Key
* Description    :
* Input          :
* Output         : None
* Return         : None
* onther         :
--------------------------------------------------------------------------*/
void App_Uds_Calc_Key(void)
{
hu's avatar
hu committed
1364 1365 1366 1367
    unsigned char CupChar1 = 0;
    unsigned char CupChar2 = 0;
    unsigned char CupChar3 = 0;
    unsigned char CupChar4 = 0;
hu's avatar
hu committed
1368

hu's avatar
hu committed
1369 1370 1371 1372
    unsigned char CupChar5 = 0;
    unsigned char CupChar6 = 0;
    unsigned char CupChar7 = 0;
    unsigned char CupChar8 = 0;
hu's avatar
hu committed
1373

hu's avatar
hu committed
1374
    unsigned char CupChar9 = 0;
hu's avatar
hu committed
1375 1376 1377 1378
    unsigned char CupChar10 = 0;
    unsigned char CupChar11 = 0;
    unsigned char CupChar12 = 0;

hu's avatar
hu committed
1379 1380 1381 1382
    CupChar1 = Cup_Key(Seed1, 1, Seed1);
    CupChar2 = Cup_Key(Seed2, 2, Seed2);
    CupChar3 = Cup_Key(Seed3, 3, Seed3);
    CupChar4 = Cup_Key(Seed4, 4, Seed4);
hu's avatar
hu committed
1383

hu's avatar
hu committed
1384 1385 1386 1387
    CupChar5 = Cup_Key(CupChar4, 1, Seed1);
    CupChar6 = Cup_Key(CupChar3, 2, Seed2);
    CupChar7 = Cup_Key(CupChar2, 3, Seed3);
    CupChar8 = Cup_Key(CupChar1, 4, Seed4);
hu's avatar
hu committed
1388

hu's avatar
hu committed
1389 1390 1391 1392
    CupChar9 = Cup_Key(CupChar8, 1, Seed1);
    CupChar10 = Cup_Key(CupChar7, 2, Seed2);
    CupChar11 = Cup_Key(CupChar6, 3, Seed3);
    CupChar12 = Cup_Key(CupChar5, 4, Seed4);
hu's avatar
hu committed
1393

hu's avatar
hu committed
1394 1395 1396 1397
    Sendseed4 = Cup_Key(CupChar12, 1, Seed1);
    Sendseed3 = Cup_Key(CupChar11, 2, Seed2);
    Sendseed2 = Cup_Key(CupChar10, 3, Seed3);
    Sendseed1 = Cup_Key(CupChar9, 4, Seed4);
hu's avatar
hu committed
1398 1399 1400 1401 1402 1403 1404
}

unsigned char Cup_Key(unsigned char KLineseed, unsigned char Num, unsigned char Seed)
{
    unsigned char CupCharL = 0;
    unsigned char CupCharR = 0;

hu's avatar
hu committed
1405 1406
    CupCharL = KLineseed;
    CupCharR = KLineseed;
hu's avatar
hu committed
1407

hu's avatar
hu committed
1408
    CupCharL = (CupCharL << Num);
hu's avatar
hu committed
1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
    CupCharR = (CupCharR >> (8 - Num));
    CupCharL = (CupCharL | CupCharR);

    CupCharL = (CupCharL ^ Seed);

    CupCharL = (~CupCharL);

    CupCharL = BitReplace(CupCharL);

    return CupCharL;
}

hu's avatar
hu committed
1421
unsigned char BitReplace(unsigned char Data)
hu's avatar
hu committed
1422 1423 1424 1425
{
    unsigned char i = 0;
    unsigned char temp = 0;

hu's avatar
hu committed
1426
    for (i = 0; i < 8; i++)
hu's avatar
hu committed
1427 1428 1429 1430 1431 1432
    {
        temp = temp << 1;
        temp |= (Data >> i) & 0x01;
    }

    return temp;
hu's avatar
hu committed
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444
}

unsigned char Common_Get_DTCstatusCHGFFK_Flag(void)
{
    return DTCstatusCHGFFK_Line;
}

void Common_Set_DTCstatusCHGFFK_Flag(unsigned char Val)
{
    DTCstatusCHGFFK_Line = Val;
}

hu's avatar
hu committed
1445 1446 1447 1448 1449 1450 1451 1452
/*-------------------------------------------------------------------------
* Function Name  : K_LINE_EOL_InitVal
* Description    : k-line数据初始化
* Input          :
* Output         : None
* Return         : None
* onther         :
--------------------------------------------------------------------------*/
hu's avatar
hu committed
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489
void K_LINE_EOL_InitVal(void)
{
    K_Line_Set.Flag = 0x7AA7A55Au;

    K_Line_Set.K_Line_LID20 = 0x00u; /* 00 应对ECE R13      //0:非应对、1:应对 */
    K_Line_Set.K_Line_LID21 = 0x00u; /* 00 EBS/ABS         //0:无、1:EBS、2:ABS(CAN应对) 3:ABS (CAN非应对) */
    K_Line_Set.K_Line_LID22 = 0x00u; /* 00 EVSC            //0:无、1:有 */
    K_Line_Set.K_Line_LID23 = 0x00u; /* 00 驻车锁定         //0:无、1:有 */
    K_Line_Set.K_Line_LID24 = 0x00u; /* 00 HSA             //0:无、1:有 */
    K_Line_Set.K_Line_LID25 = 0x00u; /* 00 AEBS            //0:无、1:有 */
    K_Line_Set.K_Line_LID26 = 0x00u; /* 00 ACC             //0:无、1:有 */
    K_Line_Set.K_Line_LID27 = 0x01u; /* 00 LDWS            //0:无、1:有 */
    K_Line_Set.K_Line_LID28 = 0x01u; /* 01 车辆间报警        //0:无、1:有 */
    K_Line_Set.K_Line_LID29 = 0x01u; /* 01 有无巡航          //0:无、1:有          /*初值1*/
    K_Line_Set.K_Line_LID2A = 0x00u; /* 00 气悬             //0:Reef、1:Rear air、2:Full air */
    K_Line_Set.K_Line_LID2B = 0x00u; /* 00 ISS             //0:无、1: eco stop、 2:Idle Stop */
    K_Line_Set.K_Line_LID2C = 0x00u; /* 00 装货台工作警报蜂鸣 //0:无、1:有             */
    K_Line_Set.K_Line_LID2D = 0x00u; /* 00 ROWS            //0:无、1:ROWS有、2LOCAL警报有 */
    K_Line_Set.K_Line_LID2E = 0x00u; /* 00 行车记录仪        //0:模拟记录仪、1:数字记录仪或行车记录仪 */
    K_Line_Set.K_Line_LID2F = 0x00u; /* 00 车型             //0:单车、1:拖车、2:全拖车 */
    K_Line_Set.K_Line_LID30 = 0x00u; /* 00 缓速器           //0:无、1:有(C&E)、2:有(F) */
    K_Line_Set.K_Line_LID31 = 0x01u; /* -- 定速巡航         //0:无、1:有 */
    K_Line_Set.K_Line_LID32 = 0x00u; /* 00 装货台种类       //0:一般、1:侧翼、2:倾倒 */
    K_Line_Set.K_Line_LID33 = 0x01u; /* 01 SCR?DPD         //0:SCR无/DPD有、1:SCR有/DPD有、2:SCR无/DPD无、3:SCR有/DPD无    /*初值1*/
    K_Line_Set.K_Line_LID34 = 0x00u; /* 00 驻车种类         //0:FULL AIR、1:AOH                     /*初值1*/
    K_Line_Set.K_Line_LID35 = 0x00u; /* -- 气压计           //0:2针式、1:1针式 */
    K_Line_Set.K_Line_LID36 = 0x00u; /* -- 低压警报压       //0:一般输出(539kPa)、1:ADR(588kPa) */
    K_Line_Set.K_Line_LID37 = 0x01u; /* -- 超限警报         //0:无、1:有 */
    K_Line_Set.K_Line_LID38 = 0x01u; /* -- 速度警报         //0:无、1:有 */
    K_Line_Set.K_Line_LID39 = 0x00u; /* 00 可变SLD          //0:无、1:1车速、2:2车速            /*初值1*/
    K_Line_Set.K_Line_LID3A = 0x00u; /* -- OEM             //0:ISZ、1:UDT */
    K_Line_Set.K_Line_LID3B = 0x00u; /* -- 预留 */
    K_Line_Set.K_Line_LID3C = 0x00u; /* -- 预留 */
    K_Line_Set.K_Line_LID3D = 0x00u; /* -- 预留 */
    K_Line_Set.K_Line_LID3E = 0x01u; /* 01 胎压匹配功能      //0:胎压功能未匹配    1:匹配 */
    K_Line_Set.K_Line_LID3F = 0x00u; /* -- 预留 */
    K_Line_Set.K_Line_LID40 = 0x00u; /* 00 发动机种类 */
hu's avatar
hu committed
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504
    K_Line_Set.K_Line_LID41 = 0x13u; /* 50 变速器种类&控制 /*初值50*/
    K_Line_Set.K_Line_LID42 = 0x00u; /* 00 驻车管道        /*初值 0*/
    K_Line_Set.K_Line_LID43 = 0x82u; /* 82 车型            /*初值44*/
    K_Line_Set.K_Line_LID44 = 0xFFu; /* FF 速度警报        /*初值FF*/
    K_Line_Set.K_Line_LID45 = 0xFFu; /* FF 发动机转速      /*初值FF*/
    K_Line_Set.K_Line_LID46 = 0xFFu; /* FF 急加速          /*初值FF*/
    K_Line_Set.K_Line_LID47 = 0xFFu; /* FF 急减速          /*初值FF*/
    K_Line_Set.K_Line_LID48 = 0xFFu; /* FF 长时间怠速      /*初值FF*/
    K_Line_Set.K_Line_LID49 = 0xFFu; /* FF 辅助驻车        /*初值FF*/
    K_Line_Set.K_Line_LID4A = 0x32u; /* 37 变速箱油         55000 */
    K_Line_Set.K_Line_LID4B = 0x32u; /* 37 差速器油         55000 */
    K_Line_Set.K_Line_LID4C = 0x32u; /* 37 离合器油         55000 */
    K_Line_Set.K_Line_LID4D = 0x64u; /* 37 动力转向油        55000 */
    K_Line_Set.K_Line_LID4E = 0x78u; /* 32 轮胎             50000 */
    K_Line_Set.K_Line_LID4F = 0x32u; /* 34 机油&滤清器      22000 */
hu's avatar
hu committed
1505 1506 1507 1508
    K_Line_Set.K_Line_LID50 = 0x00u; /* -- 预留 */
    K_Line_Set.K_Line_LID51 = 0x01u; /* 01 工作模式 */
    K_Line_Set.K_Line_LID52 = 0x00u; /* 00 电子部件设定 */

hu's avatar
hu committed
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531
    K_Line_Set.KLINE        = 0x00u;
    K_Line_Set.No_Digit1    = 0x38u; /* 01 */
    K_Line_Set.No_Digit2    = 0x39u; /* 02 */
    K_Line_Set.No_Digit3    = 0x37u; /* 03 */
    K_Line_Set.No_Digit4    = 0x39u; /* 04 */
    K_Line_Set.No_Digit5    = 0x36u; /* 05 */
    K_Line_Set.No_Digit6    = 0x38u; /* 06 */
    K_Line_Set.No_Digit7    = 0x33u; /* 07 */
    K_Line_Set.No_Digit8    = 0x30u; /* 08 */
    K_Line_Set.No_Digit9    = 0x31u; /* 09 */
    K_Line_Set.No_Digit10   = 0x30u; /* 10 */
    K_Line_Set.ECUStatus1   = 0x00u; /* 11 */
    K_Line_Set.ECUStatus2   = 0x00u; /* 12 */
    K_Line_Set.ECUStatus3   = 0x00u; /* 13 */
    K_Line_Set.ECUStatus4   = 0x00u; /* 14 */
    K_Line_Set.ECUStatus5   = 0x00u; /* 15 */
    K_Line_Set.METERCOUNT   = 0x00u; /* 16 */
    K_Line_Set.NoOfDTCFF00  = 0x00u; /* 17 */
    K_Line_Set.NoOfDTC8000  = 0x00u; /* 18 */
    K_Line_Set.TesterECU    = 0x00u; /* 19 */
    K_Line_Set.TesterECUCAN = 0x00u; /* 20 */
    K_Line_Set.User_Light1  = 10u;   /*背光亮度等级*/
    K_Line_Set.User_Light2  = 10u;   /*背光亮度等级*/
hu's avatar
hu committed
1532
}