#include "UDS_2EService_Main.h"

/**
  *2E���������
  *@param A_TA_type �յ����ݵĵ�ַ
  *@param A_Length �յ����ݵĳ���
  *@param A_Data �յ����ݵ�����
  */
void UDS_Service_2E_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t A_Data[])
{
    uint8_t NRC = positiveResponse;
    setDiagMSG(A_TA_type, A_Length, A_Data);
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC11();                                            /*2E�����Ƿ�֧�ֹ���Ѱַ*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC7F();                                            /*2E����Ự�Ƿ�֧����֤*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC33();                                            /*2E��������ȼ���֤*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC13_MinLengthCheck();                             /*2E������С������֤*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC31();                                            /*2E���񳬳�����Χ��֤*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC13_TotalLengthCheck();                           /*2E�����ܳ��ȳ�����֤*/
    }
    if(NRC == positiveResponse)
    {
        NRC = UDS_2EService_NRC22();                                            /*2E����������֤*/
    }
    if(NRC == positiveResponse)
    {
        UDS_2EService_DID();                                                    /*2E����DID�ж�*/
    }
    clearDiagMSG();                                                             /*��������Ϣ*/
}

/**
  *2E�����ӹ���
  */
void UDS_2EService_DID(void)
{
    switch(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L))/*2E����DID�ж�*/
    {
    case 0xDFEC:
        UDS_2EService_DID_DFEC();                                               /*���������ֱ�������4*/
        break;
    case 0xDFED:
        UDS_2EService_DID_DFED();                                               /*���������ֱ�������3*/
        break;
    case 0xDFEE:
        UDS_2EService_DID_DFEE();                                               /*���������ֱ�������2*/
        break;
    case 0xDFEF:
        UDS_2EService_DID_DFEF();                                               /*���������ֱ�������1*/
        break;
    case 0xF112:
        UDS_2EService_DID_F112();                                               /*��������*/
        break;
    case 0xF190:
        UDS_2EService_DID_F190();                                               /*����VIN��*/
        break;
    case 0xF197:
        UDS_2EService_DID_F197();                                               /*ECU����������*/
        break;
    case 0xF198:
        UDS_2EService_DID_F198();                                               /*��������к�*/
        break;
    case 0xF1A2:
        UDS_2EService_DID_F1A2();                                               /*ECUװ������*/
        break;
    case 0xF110:
        UDS_2EService_DID_F110();                                               /*��������*/
        break;
    case 0xF101:
        UDS_2EService_DID_F101();                                               /*��������������*/
        break;
    case 0xF102:
        UDS_2EService_DID_F102();                                               /*ECU��������2*/
        break;
    case 0xF100:
        UDS_2EService_DID_F100();                                               /*������������*/
        break;  
    case 0x7101:
        UDS_2EService_DID_7101();                                               /*�ױ����*/
        break;
    case 0x7102:
        UDS_2EService_DID_7102();                                               /*���ױ����*/
        break; 
    case 0x7103:
        UDS_2EService_DID_7103();                                               /*�屣����̱�־λ*/
        break;
    case 0x7104:
        UDS_2EService_DID_7104();                                               /*�ۼ���������־λ*/
        break;                   

    default:
        break;
    }
}

/**
  *2E����DIDDFEC
  *���������ֱ�������4
*/  
void UDS_2EService_DID_DFEC(void)
{
    uint8_t enResult = OK;
    memcpy(BootToDFlashInfo.DID_DFEC, DiagMSG.msgData.DidDetail.Data, sizeof(BootToDFlashInfo.DID_DFEC));
    enResult = write2EData(WriteBootData);
    if(enResult == OK)
    {
        UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }
}

/**
  *2E����DIDDFED
  *���������ֱ�������3
  */
void UDS_2EService_DID_DFED(void)
{
    uint8_t enResult = OK;
    memcpy(BootToDFlashInfo.DID_DFED, DiagMSG.msgData.DidDetail.Data, sizeof(BootToDFlashInfo.DID_DFED));
    enResult = write2EData(WriteBootData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }
}

/**
  *2E����DIDDFEE
  *���������ֱ�������2
  */
void UDS_2EService_DID_DFEE(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_DFEE, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_DFEE));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDDFEF
  *���������ֱ�������
  */
void UDS_2EService_DID_DFEF(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_DFEF, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_DFEF));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF112
  *��������
  */
void UDS_2EService_DID_F112(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_F112, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F112));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF190
  *����VIN��
  */
void UDS_2EService_DID_F190(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_F190, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F190));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF197
  *ECU����������
  */
void UDS_2EService_DID_F197(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_F197, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F197));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF198
  *��������к�
  */
void UDS_2EService_DID_F198(void)
{
    uint8_t enResult = OK;
    memcpy(BootToDFlashInfo.DID_F198, DiagMSG.msgData.DidDetail.Data, sizeof(BootToDFlashInfo.DID_F198));
    enResult = write2EData(WriteBootData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF19D
  *ECUװ������
  */
void UDS_2EService_DID_F1A2(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_F1A2, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F1A2));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF110
  *������������
  */
void UDS_2EService_DID_F110(void)
{
    uint8_t enResult = OK;
    EOL_SetF110(DiagMSG.msgData.DidDetail.Data, 8u);
    memcpy(Ser2EToDFlashInfo.DID_F110, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F110));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF101
  *��������������
  */
void UDS_2EService_DID_F101(void)
{
    uint8_t enResult = OK;
    EOL_SetF101(DiagMSG.msgData.DidDetail.Data, 8u);
    memcpy(Ser2EToDFlashInfo.DID_F101, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F101));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF102
  *ECU��������2
  */
void UDS_2EService_DID_F102(void)
{
    uint8_t enResult = OK;
    EOL_SetF102(DiagMSG.msgData.DidDetail.Data, 24u);
    memcpy(Ser2EToDFlashInfo.DID_F102, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F102));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DIDF100
  *������������
  */
void UDS_2EService_DID_F100(void)
{
    uint8_t enResult = OK;
    memcpy(Ser2EToDFlashInfo.DID_F100, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_F100));
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DID7101
  *�ױ����
  */
void UDS_2EService_DID_7101(void)
{

    uint8_t enResult = OK;
    uint32_t WriteService = 0u;
    uint32_t  Service = 0u;

    //if(NVM_SERVICE_RESET == 0u) 
    //{
        Service = (DiagMSG.msgData.DidDetail.Data[0] & 0xF0)>>4; 
        Service  =  Service*100000 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[0] & 0x0F) ;
        Service = Service*10000;
        WriteService = WriteService +Service ;
        
        Service = (DiagMSG.msgData.DidDetail.Data[1] & 0xF0)>>4; 
        Service  =  Service*1000 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[1] & 0x0F) ;
        Service = Service*100;
        WriteService = WriteService +Service ;
        
        Service = (DiagMSG.msgData.DidDetail.Data[2] & 0xF0)>>4; 
        Service  =  Service*10 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[2] & 0x0F) ;
        Service = Service;
        WriteService = WriteService +Service ;
        
        if(NVM_SERVICE_RESET == 0u) 
        {
           S513_Maintenance_Data_Set(WriteService);
        }
        
        Ser2EToDFlashInfo.DID_7101[0] = DiagMSG.msgData.DidDetail.Data[0];
        Ser2EToDFlashInfo.DID_7101[1] = DiagMSG.msgData.DidDetail.Data[1];
        Ser2EToDFlashInfo.DID_7101[2] = DiagMSG.msgData.DidDetail.Data[2];
        enResult = write2EData(Write2EData);
        if(enResult == OK)
        {
           UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
        }
        else
        {
            enResult = generalProgrammingFailure;
            UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
        }
    //} 
    /*else 
    {
        enResult = conditionsNotCorrect;
        if(DiagMSG.msgID == DIAG_ID_Rx_PHY) 
        {
            UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);          
        }
    }*/
}

/**
  *2E����DID7102
  *���ױ����
  */
 
void UDS_2EService_DID_7102(void)
{
    uint8_t enResult = OK;
    uint32_t WriteService = 0u;
    uint32_t  Service = 0u;

    //if(NVM_SERVICE_RESET == 1u) 
    //{
        Service = (DiagMSG.msgData.DidDetail.Data[0] & 0xF0)>>4; 
        Service  =  Service*100000 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[0] & 0x0F) ;
        Service = Service*10000;
        WriteService = WriteService +Service ;
        
        Service = (DiagMSG.msgData.DidDetail.Data[1] & 0xF0)>>4; 
        Service  =  Service*1000 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[1] & 0x0F) ;
        Service = Service*100;
        WriteService = WriteService +Service ;
        
        Service = (DiagMSG.msgData.DidDetail.Data[2] & 0xF0)>>4; 
        Service  =  Service*10 ;
        WriteService = WriteService +Service ;
        Service  =  (DiagMSG.msgData.DidDetail.Data[2] & 0x0F) ;
        Service = Service;
        WriteService = WriteService +Service ;
        
        if(NVM_SERVICE_RESET == 1u) 
        {
           S513_Maintenance_Data_Set(WriteService);
        }
        
        Ser2EToDFlashInfo.DID_7102[0] = DiagMSG.msgData.DidDetail.Data[0];
        Ser2EToDFlashInfo.DID_7102[1] = DiagMSG.msgData.DidDetail.Data[1];
        Ser2EToDFlashInfo.DID_7102[2] = DiagMSG.msgData.DidDetail.Data[2];
        enResult = write2EData(Write2EData);
        if(enResult == OK)
        {
           UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
        }
        else
        {
            enResult = generalProgrammingFailure;
            UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
        }
    //} 
    /*else 
    {
        enResult = conditionsNotCorrect;
        if(DiagMSG.msgID == DIAG_ID_Rx_PHY) 
        {
            UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);          
        }
    }*/
}

/**
  *2E����DID7103
  *�屣����̱�־λ
  */
void UDS_2EService_DID_7103(void)
{
    uint32_t WriteService = 0u;
    uint32_t  Service = 0u;
    uint8_t enResult = OK;
    if(DiagMSG.msgData.DidDetail.Data[0] == 0x01u) 
    {
        if(NVM_ODO_VALUE < 5000u) 
        {
            NVM_SERVICE_RESET = 0;
            Service = (Ser2EToDFlashInfo.DID_7101[0] & 0xF0)>>4; 
            Service  =  Service*100000 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7101[0] & 0x0F) ;
            Service = Service*10000;
            WriteService = WriteService +Service ;
            
            Service = (Ser2EToDFlashInfo.DID_7101[1] & 0xF0)>>4; 
            Service  =  Service*1000 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7101[1] & 0x0F) ;
            Service = Service*100;
            WriteService = WriteService +Service ;
            
            Service = (Ser2EToDFlashInfo.DID_7101[2] & 0xF0)>>4; 
            Service  =  Service*10 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7101[2] & 0x0F) ;
            Service = Service;
            WriteService = WriteService +Service ;            
            
            NVM_SERVISE_SET = WriteService * 10u;
            Data_Service_Interval_Reset();
        	   OldServiceMileVaule = NVM_SERVISE_SET;
        }
        else
        {
            NVM_SERVICE_RESET = 1;
        	Service = (Ser2EToDFlashInfo.DID_7102[0] & 0xF0)>>4; 
            Service  =  Service*100000 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7102[0] & 0x0F) ;
            Service = Service*10000;
            WriteService = WriteService +Service ;
            
            Service = (Ser2EToDFlashInfo.DID_7102[1] & 0xF0)>>4; 
            Service  =  Service*1000 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7102[1] & 0x0F) ;
            Service = Service*100;
            WriteService = WriteService +Service ;
            
            Service = (Ser2EToDFlashInfo.DID_7102[2] & 0xF0)>>4; 
            Service  =  Service*10 ;
            WriteService = WriteService +Service ;
            Service  =  (Ser2EToDFlashInfo.DID_7102[2] & 0x0F) ;
            Service = Service;
            WriteService = WriteService +Service ;            
            
            NVM_SERVISE_SET = WriteService * 10u;
            Data_Service_Interval_Reset();
        	   OldServiceMileVaule = NVM_SERVISE_SET;
        }
        ///OldServiceMileVaule = NVM_SERVISE_SET;
        
    }
    Ser2EToDFlashInfo.DID_7103 = 0;
    enResult = write2EData(Write2EData);
    if(enResult == OK)
    {
       UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
    }
    else
    {
        enResult = generalProgrammingFailure;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }/**/
}

/**
  *2E����DID7104
  *�ۼ���������־λ
  */
void UDS_2EService_DID_7104(void)
{
    uint8_t enResult = OK;
    if(DiagMSG.msgData.DidDetail.Data[0] == 0x01u)
    {
        if(((NVM_SUM_ODO_Reset + NVM_ODO_VALUE) < 5000u) && (NVM_Time_ODO_Reset < 3)) 
        {
             NVM_SUM_ODO_Reset =+ NVM_ODO_VALUE;
             NVM_Time_ODO_Reset++;
             Ser2EToDFlashInfo.DID_7104 = 0;
             NVM_Data_Update(NVM_ResetODO);
             Data_Clear_ODO();
             Data_Service_Interval_Reset();
             enResult = write2EData(Write2EData);
             if(enResult == OK)
             {
                UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
             }
             else
             {
                 enResult = generalProgrammingFailure;
                 UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
             }/**/
        } 
        else
        {
            enResult = conditionsNotCorrect;
            if(DiagMSG.msgID == DIAG_ID_Rx_PHY) 
            {
                UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);          
            }
        }
    
    } 
    else
    {      enResult = write2EData(Write2EData);
           if(enResult == OK)
           {
              UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
           }
           else
           {
               enResult = generalProgrammingFailure;
               UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
           }/**/
    }
}










/**
  *2E����DID6208
  *�������*/
 
void UDS_2EService_DID_6208(void)
{ 
    /*uint8_t  enResult = positiveResponse;
    /*uint16_t DID620A;*/
    /*uint32_t ODO;
    uint32_t temp;
    
    ODO = getTotalOdometer();
    temp = toUint32_t(0x00u, DiagMSG.msgData.DidDetail.Data[0], DiagMSG.msgData.DidDetail.Data[1], DiagMSG.msgData.DidDetail.Data[2]);
    if((temp <= 1000000u) && (temp > ODO))
    {
        if(temp == 1000000u)
        {
            temp = 999999u;
        }
        
        //Data_ODO_Modify(temp * 10u);
        //Services_ODO_Modify_Sync(3u);
        UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);*/
        
        /*memcpy(Ser2EToDFlashInfo.DID_6208, DiagMSG.msgData.DidDetail.Data, sizeof(Ser2EToDFlashInfo.DID_6208));
        DID620A = toUint16_t(Ser2EToDFlashInfo.DID_620A[0], Ser2EToDFlashInfo.DID_620A[1]);
        if(DID620A < 0xFFFFu)
        {
            DID620A++;
        }
        Ser2EToDFlashInfo.DID_620A[0] = (uint8_t)(DID620A >> 8u);
        Ser2EToDFlashInfo.DID_620A[1] = (uint8_t)(DID620A);
        enResult = write2EData(Write2EData);
        if(enResult == WFLASH_RW_PASS)
        {
           UDS_Service_Response(0x2Eu, POSITIVE_RSP, DIAG_ID_Tx, 2u, DiagMSG.msgData.Data);
        }
        else
        {
            enResult = generalProgrammingFailure;
            UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
        }*/
    //}
    /*else
    {
        enResult = requestOutOfRange;
        UDS_Service_Response(0x2Eu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&enResult);
    }*/
}