Обновление
This commit is contained in:
parent
3717711037
commit
ba8cc5663e
49
StatusData.c
49
StatusData.c
|
|
@ -2,8 +2,6 @@
|
|||
// Created by cfif on 03.12.2025.
|
||||
//
|
||||
#include "StatusData.h"
|
||||
#include "DataNonVolatile.h"
|
||||
#include "StorageOnFlash.h"
|
||||
|
||||
tStatusData statusData;
|
||||
|
||||
|
|
@ -293,9 +291,10 @@ const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_CF[256] =
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Status_Activated_Cal_Num, sizeof(statusData.Status_Activated_Cal_Num), "0xCFFE : Status_Activated_Cal_Num"},
|
||||
{&statusData.Internal_SW_Version, sizeof(statusData.Internal_SW_Version), "Internal_SW_Version"}
|
||||
{&statusData.ecu.Internal_SW_Version, sizeof(statusData.ecu.Internal_SW_Version), "Internal_SW_Version"}
|
||||
};
|
||||
|
||||
|
||||
const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_F1[256] = {
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -378,7 +377,7 @@ const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_F1[256] =
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Software_classification_identification, sizeof(statusData.Software_classification_identification), "0xF151 : Software classification identification"},
|
||||
{statusData.ecu.Software_classification_identification, sizeof(statusData.ecu.Software_classification_identification), "0xF151 : Software classification identification"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -387,7 +386,7 @@ const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_F1[256] =
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Tester_Fingerprint, sizeof(statusData.Tester_Fingerprint), "0xF15A : Tester_Fingerprint"},
|
||||
{&statusData.ecu.Tester_Fingerprint, sizeof(statusData.ecu.Tester_Fingerprint), "0xF15A : Tester_Fingerprint"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -428,24 +427,24 @@ const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_F1[256] =
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Boot_SW_Fingerprint, sizeof(statusData.Boot_SW_Fingerprint), "0xF183 : Boot SW Fingerprint"},
|
||||
{&statusData.Application_SW_Fingerprint, sizeof(statusData.Application_SW_Fingerprint), "0xF184 : Application SW Fingerprint"},
|
||||
{&statusData.ecu.Boot_SW_Fingerprint, sizeof(statusData.ecu.Boot_SW_Fingerprint), "0xF183 : Boot SW Fingerprint"},
|
||||
{&statusData.ecu.Application_SW_Fingerprint, sizeof(statusData.ecu.Application_SW_Fingerprint), "0xF184 : Application SW Fingerprint"},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Status_Active_Diagnostic_Session, sizeof(statusData.Status_Active_Diagnostic_Session), "0xF186 : Active Diagnostic Session"},
|
||||
{&statusData.Spare_Part_Number, sizeof(statusData.Spare_Part_Number), "0xF187 : Spare Part Number"},
|
||||
{&statusData.ecu.Spare_Part_Number, sizeof(statusData.ecu.Spare_Part_Number), "0xF187 : Spare Part Number"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Serial_Number, sizeof(statusData.Serial_Number), "0xF18C : Serial Number"},
|
||||
{statusData.ecu.Serial_Number, sizeof(statusData.ecu.Serial_Number), "0xF18C : Serial Number"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Vehicle_Identification, sizeof(statusData.Vehicle_Identification), "0xF190 : Vehicle Identification"},
|
||||
{statusData.ECU_hardware_number_NAMI, sizeof(statusData.ECU_hardware_number_NAMI), "0xF191 : ECU hardware number (NAMI)"},
|
||||
{statusData.ECU_hardware_number_ECU_supplier, sizeof(statusData.ECU_hardware_number_ECU_supplier), "0xF192 : ECU hardware number (ECU supplier)"},
|
||||
{statusData.ecu.Vehicle_Identification, sizeof(statusData.ecu.Vehicle_Identification), "0xF190 : Vehicle Identification"},
|
||||
{statusData.ecu.ECU_hardware_number_NAMI, sizeof(statusData.ecu.ECU_hardware_number_NAMI), "0xF191 : ECU hardware number (NAMI)"},
|
||||
{statusData.ecu.ECU_hardware_number_ECU_supplier, sizeof(statusData.ecu.ECU_hardware_number_ECU_supplier), "0xF192 : ECU hardware number (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{statusData.ECU_software_number_ECU_supplier, sizeof(statusData.ECU_software_number_ECU_supplier), "0xF194 : ECU software number (ECU supplier)"},
|
||||
{statusData.ecu.ECU_software_number_ECU_supplier, sizeof(statusData.ecu.ECU_software_number_ECU_supplier), "0xF194 : ECU software number (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -541,7 +540,7 @@ const eUds_ReadDataByIdentifier_22_com uds_ReadDataByIdentifier_22_com_F1[256] =
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.ECU_boot_software_identification_ECU_supplier, sizeof(statusData.ECU_boot_software_identification_ECU_supplier), "0xF1F4 : ECU boot software identification (ECU supplier)"},
|
||||
{statusData.ecu.ECU_boot_software_identification_ECU_supplier, sizeof(statusData.ecu.ECU_boot_software_identification_ECU_supplier), "0xF1F4 : ECU boot software identification (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -842,7 +841,7 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_CF[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Status_Activated_Cal_Num, sizeof(statusData.Status_Activated_Cal_Num), "0xCFFE : Status_Activated_Cal_Num"},
|
||||
{&statusData.Internal_SW_Version, sizeof(statusData.Internal_SW_Version), "Internal_SW_Version"}
|
||||
{&statusData.ecu.Internal_SW_Version, sizeof(statusData.ecu.Internal_SW_Version), "Internal_SW_Version"}
|
||||
};
|
||||
|
||||
const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256] = {
|
||||
|
|
@ -927,7 +926,7 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Software_classification_identification, sizeof(statusData.Software_classification_identification), "0xF151 : Software classification identification"},
|
||||
{statusData.ecu.Software_classification_identification, sizeof(statusData.ecu.Software_classification_identification), "0xF151 : Software classification identification"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -936,7 +935,7 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Tester_Fingerprint, sizeof(statusData.Tester_Fingerprint), "0xF15A : Tester_Fingerprint"},
|
||||
{&statusData.ecu.Tester_Fingerprint, sizeof(statusData.ecu.Tester_Fingerprint), "0xF15A : Tester_Fingerprint"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -977,8 +976,8 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Boot_SW_Fingerprint, sizeof(statusData.Boot_SW_Fingerprint), "0xF183 : Boot SW Fingerprint"},
|
||||
{&statusData.Application_SW_Fingerprint, sizeof(statusData.Application_SW_Fingerprint), "0xF184 : Application SW Fingerprint"},
|
||||
{&statusData.ecu.Boot_SW_Fingerprint, sizeof(statusData.ecu.Boot_SW_Fingerprint), "0xF183 : Boot SW Fingerprint"},
|
||||
{&statusData.ecu.Application_SW_Fingerprint, sizeof(statusData.ecu.Application_SW_Fingerprint), "0xF184 : Application SW Fingerprint"},
|
||||
{NULL, 0, ""},
|
||||
{&statusData.Status_Active_Diagnostic_Session, sizeof(statusData.Status_Active_Diagnostic_Session), "0xF186 : Active Diagnostic Session"},
|
||||
{NULL, 0, "0xF187 : Spare Part Number"},
|
||||
|
|
@ -986,15 +985,15 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Serial_Number, sizeof(statusData.Serial_Number), "0xF18C : Serial Number"},
|
||||
{statusData.ecu.Serial_Number, sizeof(statusData.ecu.Serial_Number), "0xF18C : Serial Number"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.Vehicle_Identification, sizeof(statusData.Vehicle_Identification), "0xF190 : Vehicle Identification"},
|
||||
{statusData.ECU_hardware_number_NAMI, sizeof(statusData.ECU_hardware_number_NAMI), "0xF191 : ECU hardware number (NAMI)"},
|
||||
{statusData.ECU_hardware_number_ECU_supplier, sizeof(statusData.ECU_hardware_number_ECU_supplier), "0xF192 : ECU hardware number (ECU supplier)"},
|
||||
{statusData.ecu.Vehicle_Identification, sizeof(statusData.ecu.Vehicle_Identification), "0xF190 : Vehicle Identification"},
|
||||
{statusData.ecu.ECU_hardware_number_NAMI, sizeof(statusData.ecu.ECU_hardware_number_NAMI), "0xF191 : ECU hardware number (NAMI)"},
|
||||
{statusData.ecu.ECU_hardware_number_ECU_supplier, sizeof(statusData.ecu.ECU_hardware_number_ECU_supplier), "0xF192 : ECU hardware number (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{statusData.ECU_software_number_ECU_supplier, sizeof(statusData.ECU_software_number_ECU_supplier), "0xF194 : ECU software number (ECU supplier)"},
|
||||
{statusData.ecu.ECU_software_number_ECU_supplier, sizeof(statusData.ecu.ECU_software_number_ECU_supplier), "0xF194 : ECU software number (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
@ -1090,7 +1089,7 @@ const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_F1[256]
|
|||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{statusData.ECU_boot_software_identification_ECU_supplier, sizeof(statusData.ECU_boot_software_identification_ECU_supplier), "0xF1F4 : ECU boot software identification (ECU supplier)"},
|
||||
{statusData.ecu.ECU_boot_software_identification_ECU_supplier, sizeof(statusData.ecu.ECU_boot_software_identification_ECU_supplier), "0xF1F4 : ECU boot software identification (ECU supplier)"},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
{NULL, 0, ""},
|
||||
|
|
|
|||
43
StatusData.h
43
StatusData.h
|
|
@ -6,33 +6,7 @@
|
|||
#define HVAC_M7_STATUSDATA_H
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
// BCD в двоичное число
|
||||
#define bcd_to_binary(bcd) (((bcd >> 4) * 10) + (bcd & 0x0F))
|
||||
|
||||
// Двоичное число в BCD
|
||||
#define binary_to_bcd(binary) (((binary / 10) << 4) | (binary % 10))
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint8_t year; // BCD: 0x18 = 2018 год
|
||||
uint8_t month; // BCD: 0x10 = октябрь
|
||||
uint8_t day; // BCD: 0x16 = 16 число
|
||||
char tester_serial[9]; // ASCII: "123456789"
|
||||
} tFingerprint;
|
||||
|
||||
// Packet [4] Byte
|
||||
//Data Objects:
|
||||
//[0:0] Date year (yy), Unsigned (1Byte)
|
||||
// - 02 – 99
|
||||
//[1:0] Date month (mm), Unsigned (1Byte)
|
||||
// - 01 – 12
|
||||
//[2:0] Date day (dd), Unsigned (1Byte)
|
||||
// - 01-31
|
||||
//[3:0] Revision, Unsigned (1Byte)
|
||||
typedef struct {
|
||||
uint8_t SW[4];
|
||||
uint8_t MBD[4];
|
||||
} tInternal_SW_Version;
|
||||
#include "DataNonVolatile.h"
|
||||
|
||||
typedef enum {
|
||||
AROMA_NOT_PRESENT = 0,
|
||||
|
|
@ -289,19 +263,7 @@ typedef struct {
|
|||
|
||||
tStatus_Duct_Select Status_Duct_Select;
|
||||
|
||||
|
||||
tInternal_SW_Version Internal_SW_Version;
|
||||
char Software_classification_identification[15];
|
||||
tFingerprint Tester_Fingerprint;
|
||||
tFingerprint Boot_SW_Fingerprint;
|
||||
tFingerprint Application_SW_Fingerprint;
|
||||
char Spare_Part_Number[27];
|
||||
char Serial_Number[26];
|
||||
char Vehicle_Identification[17];
|
||||
char ECU_hardware_number_NAMI[13];
|
||||
char ECU_hardware_number_ECU_supplier[2];
|
||||
char ECU_software_number_ECU_supplier[2];
|
||||
char ECU_boot_software_identification_ECU_supplier[2];
|
||||
ecu_identification_t ecu;
|
||||
|
||||
} tStatusData;
|
||||
|
||||
|
|
@ -332,4 +294,5 @@ extern const eUds_WriteDataByIdentifier_2E_com uds_WriteDataByIdentifier_2E_com_
|
|||
extern const eUds_IoDataByIdentifier_2F_com uds_IoDataByIdentifier_2F_com_CF[256];
|
||||
extern const eUds_IoDataByIdentifier_2F_com uds_IoDataByIdentifier_2F_com_F1[256];
|
||||
|
||||
extern tStatusData statusData;
|
||||
#endif //HVAC_M7_STATUSDATA_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue