Commit 3903d112 authored by 何锐's avatar 何锐

feat:修改

parent 7e42f9ee
......@@ -304,12 +304,13 @@ void build_number1(void)
Send_7CE_Data.Byte5Data = 0x00;
Send_7CE_Data.Byte6Data = 0x00;
Send_7CE_Data.Byte7Data = 0x00;
CanFD_Send_StandMsg(CANFD0_Type, 0x781, BUF_40, TX_ISR_EN, (uint8_t*)&Send_7CE_Data.mdata, 8);
CanFD_Send_StandMsg(CANFD0_Type, 0x702, BUF_40, TX_ISR_EN, (uint8_t*)&Send_7CE_Data.mdata, 8);
SendNUM1 = FINISH;
}
if (BetweenTime(100,200) && RxFinish == FINISH ) { //???????
App_Uds_Calc_Key(&MultiplePack.Data[0]);
GetNUM1(0);GetNUM1(1);GetNUM1(2);GetNUM1(3);GetNUM1(4);GetNUM1(5);GetNUM1(6);GetNUM1(7);
}
else if (BetweenTime(200,300) && MultiplePack.Data[0] != 0x0){
......@@ -341,7 +342,22 @@ void build_number1(void)
Buzzer_Alarm();
}
}
uint8_t DiagnoCtl_key [4];
void App_Uds_Calc_Key(uint8_t seed[4])
{
uint8_t Xor[4] = {0x56,0x45,0x73,0x54};
uint8_t Cal[4];
Cal[0] = seed[0] ^ Xor[0];
Cal[1] = seed[1] ^ Xor[1];
Cal[2] = seed[2] ^ Xor[2];
Cal[3] = seed[3] ^ Xor[3];
DiagnoCtl_key[0] = ((Cal[0] & 0x0f) << 4) | (Cal[1] & 0xf0);
DiagnoCtl_key[1] = ((Cal[1] & 0x0f) << 4) | ((Cal[2] & 0xf0)>>4);
DiagnoCtl_key[2] = (Cal[2] & 0xf0) | ((Cal[3] & 0xf0) >>4);
DiagnoCtl_key[3] = ((Cal[3] & 0x0f) << 4) | (Cal[0] & 0x0f);
}
//内部版本号2
void build_number2(void)
{
......@@ -372,7 +388,7 @@ void build_number2(void)
Send_7CE_Data.Byte5Data = 0x00;
Send_7CE_Data.Byte6Data = 0x00;
Send_7CE_Data.Byte7Data = 0x00;
CanFD_Send_StandMsg(CANFD0_Type, 0x781, BUF_40, TX_ISR_EN, (uint8_t*)&Send_7CE_Data.mdata, 8);
CanFD_Send_StandMsg(CANFD0_Type, 0x782, BUF_40, TX_ISR_EN, (uint8_t*)&Send_7CE_Data.mdata, 8);
SendNUM2 = FINISH;
}
......
......@@ -2,5 +2,5 @@
#define _BSP_BUTTON_AUTO
extern void TestReadFuel(void);
extern void App_Uds_Calc_Key(uint8_t seed[4]);
#endif
\ 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