Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈家乐
jiancetai
Commits
466db1a8
Commit
466db1a8
authored
Sep 23, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加实时读取UUID功能
parent
1c53d23e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
24 deletions
+104
-24
CAN_APP.c
YueJin_test_bench/source/Appliciation/CAN_APP.c
+81
-22
CAN_APP.h
YueJin_test_bench/source/Appliciation/CAN_APP.h
+3
-0
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+9
-2
Display_Info.h
YueJin_test_bench/source/Appliciation/Display_Info.h
+1
-0
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+10
-0
No files found.
YueJin_test_bench/source/Appliciation/CAN_APP.c
View file @
466db1a8
...
...
@@ -1358,8 +1358,23 @@ void Get_PN_msg(void)
PNtestresult
=
1
;
}
}
uint8_t
writebeing
=
1
;
uint8_t
UIDresult
=
0
;
uint8_t
UIDcode1last
[
33
];
uint8_t
canlost
;
uint8_t
resettime
=
0
;
void
uidreset
(
void
)
{
if
(
resettime
>
50
)
{
UIDresult
=
0
;
resettime
=
0
;
Display_TFT_Clear_UID2
();
canlost
=
1
;
}
}
void
Get_UID_msg
(
void
)
{
u8get714msg
[
0
]
=
Get_CAN_CH0_ID_7A9_byte0_Sig
();
...
...
@@ -1372,7 +1387,7 @@ void Get_UID_msg(void)
u8get714msg
[
7
]
=
Get_CAN_CH0_ID_7A9_byte7_Sig
();
if
((
u8get714msg
[
0
]
==
0x10
)
&&
(
u8get714msg
[
4
]
==
0x01
)
&&
(
UIDresult
==
0
))
{
memset
(
UIDcode1
,
0xFF
,
sizeof
(
UIDcode1
));
//
memset(UIDcode1,0xFF,sizeof(UIDcode1));
// memcpy(UIDcode1,&u8get714msg[1],32);
UIDcode1
[
0
]
=
u8get714msg
[
5
];
UIDcode1
[
1
]
=
u8get714msg
[
6
];
...
...
@@ -1427,33 +1442,36 @@ void Get_UID_msg(void)
{
UIDcode1
[
31
]
=
u8get714msg
[
1
];
UIDcode1
[
32
]
=
0xFF
;
// for(int i = 0;i<33;i++)
// {
// if(UIDcode2[i] != UIDcode1[i])
// {
UIDresult
=
6
;
if
(
writebeing
)
UIDresult
=
0
;
resettime
=
0
;
if
(
canlost
==
0
)
{
for
(
int
i
=
0
;
i
<
33
;
i
++
)
{
if
(
UIDcode1last
[
i
]
!=
UIDcode1
[
i
])
{
General_Number_Disp
(
UIDcode1
,
95
,
225
);
shouuid
();
}
}
}
else
{
General_Number_Disp
(
UIDcode1
,
95
,
225
);
writebeing
=
0
;
shouuid
();
canlost
=
0
;
}
for
(
int
i
=
0
;
i
<
33
;
i
++
)
{
UIDcode1last
[
i
]
=
UIDcode1
[
i
];
}
// }
// }
// for(int i = 0;i<33;i++)
// {
// UIDcode2[i] = UIDcode1[i];
// }
// UIDresult = 6;
// zhenduanstep = 12;
}
// else if((u8get714msg[0] == 0x02) && (UIDresult == 6))
// {
// zhenduanstep = 9;
// }
}
uint32_t
ValidSeedKey
;
uint32_t
GenerateKey
(
uint8_t
*
Seed
)
{
...
...
@@ -1550,7 +1568,6 @@ uint8_t chaengUDSstep = 0;
uint8_t
seednum
[
4
]
=
{
0
};
uint32_t
UDS_time
=
0
;
extern
uint32_t
fakedelay
;
uint8_t
resettime
=
0
;
uint8_t
resetflag
=
0
;
extern
uint32_t
fakedelay
;
uint32_t
resetpowtime
=
0
;
...
...
@@ -1724,4 +1741,46 @@ void Opentracksta(void)
default:
break
;
}
}
uint8_t
readstep
=
0
;
void
UIDRead
(
void
)
{
CAN_Frame_st_t
m_msg9
;
uint8_t
data9
[
8
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
switch
(
readstep
)
{
case
0
:
//读取UID
data9
[
0
]
=
0x03
;
data9
[
1
]
=
0x22
;
data9
[
2
]
=
0x50
;
data9
[
3
]
=
0x01
;
data9
[
4
]
=
0xAA
;
data9
[
5
]
=
0xAA
;
data9
[
6
]
=
0xAA
;
data9
[
7
]
=
0xAA
;
init_CAN_Frame
(
&
m_msg9
,
0x7A1
,
8
,
1
,
data9
);
can_mid
(
m_msg9
);
readstep
++
;
break
;
case
1
:
data9
[
0
]
=
0x30
;
data9
[
1
]
=
0x00
;
data9
[
2
]
=
0x00
;
data9
[
3
]
=
0xAA
;
data9
[
4
]
=
0xAA
;
data9
[
5
]
=
0xAA
;
data9
[
6
]
=
0xAA
;
data9
[
7
]
=
0xAA
;
init_CAN_Frame
(
&
m_msg9
,
0x7A1
,
8
,
1
,
data9
);
can_mid
(
m_msg9
);
readstep
++
;
break
;
default:
readstep
=
0
;
break
;
}
}
\ No newline at end of file
YueJin_test_bench/source/Appliciation/CAN_APP.h
View file @
466db1a8
...
...
@@ -57,6 +57,8 @@ void resetchangeUDSfuc(void);
void
resetpowerfuel
(
void
);
void
UIDWrite
(
void
);
extern
void
Get_SWIN_msg
(
void
);
extern
void
uidreset
(
void
);
extern
void
UIDRead
(
void
);
extern
uint8_t
UIDcode1
[
33
];
extern
uint8_t
UIDcode2
[
33
];
extern
uint8_t
UIDNumber
[
19
];
...
...
@@ -71,4 +73,5 @@ extern uint8_t UIDresult;
extern
uint8_t
writebeing
;
extern
uint8_t
u8get714msg
[
8
];
extern
uint8_t
UIDdelay
;
extern
uint8_t
resettime
;
#endif
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
466db1a8
...
...
@@ -3506,7 +3506,7 @@ void Display_TFT_Clear_UID(void)
void
Display_TFT_Clear_UID2
(
void
)
{
TFT_LCD_Draw_Box
(
0
,
220
,
300
,
290
,
TFT_LCD_FILL_FULL
,
TFT_LCD_TYPE_CLR
);
TFT_LCD_Draw_Box
(
0
,
220
,
239
,
290
,
TFT_LCD_FILL_FULL
,
TFT_LCD_TYPE_CLR
);
}
void
Display_Add
(
void
)
...
...
@@ -4212,6 +4212,8 @@ void Get_static_Current(void)
}
if
(
loc_ret1
!=
0
)
{
TFT_LCD_Draw_Bmp
(
3
,
60
,
(
uint8_t
*
)
gImage_Dyy_words_5X6_Y137
);
TFT_LCD_Draw_Bmp
(
190
,
60
,
(
uint8_t
*
)
gImage_Number_15_white_PiontX0_Y0
);
GUI_General_Digit_Display
(
loc_ret1
,
Num_15
,
3
,
0
,
CurrentDigitNum09PosX
,
60
);
// if(loc_ret1 > 10)
...
...
@@ -4323,7 +4325,7 @@ void Display_Version_Info(uint32_t ON_OFF)
// TFT_LCD_Draw_Bmp(3, 160, ( uint8_t * )gImage_Alarm_12_WordX6_Y165); //24脚输出占空比
// TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Alarm_13_ImageX222_Y166); //%
// TFT_LCD_Draw_Bmp(3, 290, ( uint8_t * )gImage_gImage_checkVX6_Y165 ); //检测台版本号
uint8_t
mbuff
[
10
]
=
{
2
,
0
,
2
,
5
,
97
,
0
,
7
,
3
,
0
,
0xff
};
uint8_t
mbuff
[
10
]
=
{
2
,
0
,
2
,
5
,
97
,
0
,
9
,
2
,
3
,
0xff
};
General_Number_Disp
(
mbuff
,
115
,
25
);
//检测台版本号
// General_Number_Disp(UIDNumber, 85, 120); //固定UID数字
// General_Number_Disp(UIDNumber2, 70, 146); //可调UID数字
...
...
@@ -5150,3 +5152,8 @@ void Buzzer_Warning(void)
Display_Menu_Type
=
1
;
}
}
void
shouuid
(
void
)
{
TFT_LCD_Draw_Bmp
(
3
,
225
,
(
uint8_t
*
)
gImage_JCT_08X0_Y0
);
//读取UID
}
\ No newline at end of file
YueJin_test_bench/source/Appliciation/Display_Info.h
View file @
466db1a8
...
...
@@ -72,6 +72,7 @@ void Display_Send_ODO(uint8_t fuel);
void
Display_Set_Buff
(
void
);
extern
void
Send_Init
(
void
);
extern
void
shouuid
(
void
);
void
Buzzer_Start
(
void
);
void
Buzzer_Stop
(
void
);
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
466db1a8
...
...
@@ -75,6 +75,16 @@ extern uint8_t fuelreset3;
extern
uint8_t
fuelreset4
;
void
Sys_Run_Mode_10ms_Tasks_Group
(
void
)
{
if
((
resettime
<
250
)
&&
(
writeflag
==
0
))
{
resettime
++
;
}
if
((
writeflag
==
0
)
&&
(
begin714
==
1
))
{
uidreset
();
UIDRead
();
}
// if(MENU_CHECK_STEP == 1 && fuelreset1 == 0)
// {
// fuelreset1 = 1;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment