Обновление
This commit is contained in:
parent
8cd8b89884
commit
75a7b317ee
26
CanUds.c
26
CanUds.c
|
|
@ -1319,6 +1319,14 @@ static uint16_t RequestDownload_34(tCanUds *env) {
|
|||
return setResponseError(env, UDS_RequestDownload, UDS_error_requestOutOfRange);
|
||||
}
|
||||
|
||||
if (env->currentSession == UDS_session_defaultSession) {
|
||||
return setResponseError(env, UDS_RoutineControl, UDS_error_conditionsNotCorrect);
|
||||
}
|
||||
|
||||
if (!env->SA.stateSecurityAccess) {
|
||||
return setResponseError(env, UDS_RoutineControl, UDS_error_securityAccessDenied);
|
||||
}
|
||||
|
||||
tRequestDownload_Response *requestDownload_Response = (tRequestDownload_Response *) env->dataResponse;
|
||||
requestDownload_Response->ServiceId = UDS_RequestDownload | 0b1000000;
|
||||
requestDownload_Response->lengthFormatIdentifier = 0x20; // 2 байта - длина поля maxNumberOfBlockLength
|
||||
|
|
@ -1350,6 +1358,17 @@ static uint16_t TransferData_36(tCanUds *env) {
|
|||
return setResponseError(env, UDS_TransferData, UDS_error_incorrectMessageLengthOrInvalidFormat);
|
||||
}
|
||||
|
||||
if ((env->currentSession == UDS_session_defaultSession) ||
|
||||
(env->currentSession == UDS_session_extendedDiagnosticSession)) {
|
||||
return setResponseError(env, UDS_RoutineControl, UDS_error_conditionsNotCorrect);
|
||||
}
|
||||
|
||||
if (!env->SA.stateSecurityAccess) {
|
||||
return setResponseError(env, UDS_RoutineControl, UDS_error_securityAccessDenied);
|
||||
}
|
||||
|
||||
// setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
|
||||
if (osMutexAcquire(env->access, 1000) == osOK) {
|
||||
env->currentSessionTesterPresentTimeout = SystemGetMs() + timeout_session_S3_Server;
|
||||
osMutexRelease(env->access);
|
||||
|
|
@ -1381,6 +1400,13 @@ static uint16_t TransferData_36(tCanUds *env) {
|
|||
// начало --------------------------- RequestTransferExit ---------------------------------------------------------
|
||||
|
||||
static uint16_t RequestTransferExit_37(tCanUds *env) {
|
||||
|
||||
if ((env->currentSession == UDS_session_defaultSession) ||
|
||||
(env->currentSession == UDS_session_extendedDiagnosticSession)) {
|
||||
return setResponseError(env, UDS_RoutineControl, UDS_error_conditionsNotCorrect);
|
||||
}
|
||||
|
||||
|
||||
tRequestTransferExit_Request *com = (tRequestTransferExit_Request *) env->data->data;
|
||||
|
||||
tRequestTransferExit_Response *requestTransferExit_Response = (tRequestTransferExit_Response *) env->dataResponse;
|
||||
|
|
|
|||
Loading…
Reference in New Issue