Обновление
This commit is contained in:
parent
0bec8d137d
commit
a2b34302c2
63
CanUds.c
63
CanUds.c
|
|
@ -66,6 +66,61 @@ static void PrintfDebug(uint8_t *data, uint8_t dlc) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSecurityAccessDenied(tCanUds *env, tPermissionSession isPermissionSession) {
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
switch (isPermissionSession) {
|
||||||
|
|
||||||
|
case perm_session_defaultSession: {
|
||||||
|
if (env->currentSession == UDS_session_defaultSession)
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_programmingSession: {
|
||||||
|
if (env->currentSession == UDS_session_programmingSession)
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_extendedDiagnosticSession: {
|
||||||
|
if (env->currentSession == UDS_session_extendedDiagnosticSession)
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_defaultSession_programmingSession: {
|
||||||
|
if ((env->currentSession == UDS_session_defaultSession) ||
|
||||||
|
(env->currentSession == UDS_session_programmingSession))
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_defaultSession_extendedDiagnosticSession: {
|
||||||
|
if ((env->currentSession == UDS_session_defaultSession) ||
|
||||||
|
(env->currentSession == UDS_session_extendedDiagnosticSession))
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_extendedDiagnosticSession_programmingSession: {
|
||||||
|
if ((env->currentSession == UDS_session_extendedDiagnosticSession) ||
|
||||||
|
(env->currentSession == UDS_session_programmingSession))
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case perm_session_all: {
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
char *sendLogCanUdsHex(tCanUds *env, uint8_t *data, size_t size) {
|
char *sendLogCanUdsHex(tCanUds *env, uint8_t *data, size_t size) {
|
||||||
memset(env->hexString, 0, sizeof(env->hexString));
|
memset(env->hexString, 0, sizeof(env->hexString));
|
||||||
|
|
@ -222,6 +277,14 @@ static uint16_t ReadDataByIdentifier_22(tCanUds *env) {
|
||||||
if (dataIdentifier_hi == 0xCF) {
|
if (dataIdentifier_hi == 0xCF) {
|
||||||
|
|
||||||
if (uds_ReadDataByIdentifier_22_com_CF[dataIdentifier_lo].data != NULL) {
|
if (uds_ReadDataByIdentifier_22_com_CF[dataIdentifier_lo].data != NULL) {
|
||||||
|
|
||||||
|
|
||||||
|
// if (uds_ReadDataByIdentifier_22_com_CF[dataIdentifier_lo].isPermissionSession != NULL) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint16_t response_size = uds_ReadDataByIdentifier_22_com_CF[dataIdentifier_lo].size;
|
uint16_t response_size = uds_ReadDataByIdentifier_22_com_CF[dataIdentifier_lo].size;
|
||||||
|
|
||||||
env->dataResponse[0] = UDS_ReadDataByIdentifier | 0b1000000;
|
env->dataResponse[0] = UDS_ReadDataByIdentifier | 0b1000000;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue