Commit 63c7b89b authored by 李秉薇's avatar 李秉薇

同步NS08诊断测试问题

parent 72879693
......@@ -146,7 +146,7 @@ uint8_t UDS_10Service_Sub_NRC12(void)
{
uint8_t NRC = positiveResponse;
if((DiagMSG.msgData.SidDetail.SubID == DefaultSession) || (DiagMSG.msgData.SidDetail.SubID == ProgrammingSession) || (DiagMSG.msgData.SidDetail.SubID == ExtendedDiagnosticSession)
|| (DiagMSG.msgData.Data[0] = 0x60))
|| (DiagMSG.msgData.Data[0] == 0x60))
{
NRC = positiveResponse;
}
......
......@@ -273,7 +273,19 @@ uint8_t UDS_19Service_Sub_NRC13_TotalLengthCheck(void)
NRC = positiveResponse;
}
}
if(DiagMSG.msgData.SidDetail.SubID == ReportDTCSnapshotRecordByDTCNumber)
if(DiagMSG.msgData.SidDetail.SubID == ReportDTCSnapshotRecordByDTCNumber)//04
{
if(DiagMSG.msgDLC != 5u)
{
NRC = incorrectMessageLength;
UDS_Service_Response(0x19u, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&NRC);
}
else
{
NRC = positiveResponse;
}
}
if(DiagMSG.msgData.SidDetail.SubID == reportDTCExtendedDataRecordByDTCNumber)//06
{
if(DiagMSG.msgDLC != 5u)
{
......@@ -285,7 +297,7 @@ uint8_t UDS_19Service_Sub_NRC13_TotalLengthCheck(void)
NRC = positiveResponse;
}
}
if(DiagMSG.msgData.SidDetail.SubID == ReportSupportedDTC)
if(DiagMSG.msgData.SidDetail.SubID == ReportSupportedDTC)//0A
{
if(DiagMSG.msgDLC != 1u)
{
......
......@@ -85,6 +85,87 @@ uint8_t UDS_2FService_NRC13_MinLengthCheck(void)
*@return 负反馈编号
*/
uint8_t UDS_2FService_NRC31(void)
{
uint8_t NRC = requestOutOfRange;
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F80u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F81u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F82u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F83u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F84u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F85u)
{
if(DiagMSG.msgData.DidDetail.Data[0] == 0u)
{
NRC = positiveResponse;
}
if(DiagMSG.msgData.DidDetail.Data[0] == 3u)
{
NRC = positiveResponse;
}
}
if((NRC == requestOutOfRange) && (DiagMSG.msgID == DIAG_ID_Rx_PHY))
{
UDS_Service_Response(0x2Fu, NEGATIVE_RSP, DIAG_ID_Tx, 1u, (uint8_t*)&NRC);
}
return NRC;
}
/**
*2F服务超出请求范围验证
*功能寻址下屏蔽该负反馈
*@return 负反馈编号
*/
uint8_t UDS_2FService_NRC31_Total(void)
{
uint8_t NRC = requestOutOfRange;
if(getDID(DiagMSG.msgData.DidDetail.DID_H, DiagMSG.msgData.DidDetail.DID_L) == 0x3F80u)
......
......@@ -12,5 +12,6 @@ uint8_t UDS_2FService_NRC13_MinLengthCheck(void);
uint8_t UDS_2FService_NRC31(void);
uint8_t UDS_2FService_NRC13_TotalLengthCheck(void);
uint8_t UDS_2FService_NRC22(void);
uint8_t UDS_2FService_NRC31_Total(void);
#endif
\ No newline at end of file
......@@ -42,6 +42,10 @@ void UDS_Service_2F_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t A_
NRC = UDS_2FService_NRC13_TotalLengthCheck(); /*2F服务总长度长度验证*/
}
if(NRC == positiveResponse)
{
NRC = UDS_2FService_NRC31_Total(); /*2F服务超出请求范围验证*/
}
if(NRC == positiveResponse)
{
NRC = UDS_2FService_NRC22(); /*2F服务条件验证*/
}
......@@ -104,7 +108,7 @@ void UDS_2FService_DID_3F80(void)
LEDContrl.Data[3] = DiagMSG.msgData.DidDetail.Data[4];
len = 7;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
/**
......@@ -126,7 +130,7 @@ void UDS_2FService_DID_3F81(void)
DiagVSpeedValue[1] = DiagMSG.msgData.DidDetail.Data[2];
len = 5;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
/**
......@@ -148,7 +152,7 @@ void UDS_2FService_DID_3F82(void)
DiagESpeedValue[1] = DiagMSG.msgData.DidDetail.Data[2];
len = 5;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
/**
......@@ -169,7 +173,7 @@ void UDS_2FService_DID_3F83(void)
DiagBackLight = DiagMSG.msgData.DidDetail.Data[1];
len = 4;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
/**
......@@ -191,7 +195,7 @@ void UDS_2FService_DID_3F84(void)
//DiagLCD = DiagMSG.msgData.DidDetail.Data[1];
len = 4;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
/**
......@@ -211,5 +215,5 @@ void UDS_2FService_DID_3F85(void)
DiagBuzzer = DiagMSG.msgData.DidDetail.Data[1];
len = 4;
}
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, 3u, DiagMSG.msgData.Data);
UDS_Service_Response(0x2Fu, POSITIVE_RSP, DIAG_ID_Tx, len, DiagMSG.msgData.Data);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment