Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
car-controlserver
Project
Project
Details
Activity
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
wenzhongjian
car-controlserver
Commits
ab37bba1
Commit
ab37bba1
authored
Jul 08, 2025
by
学习的菜鸟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决了验证bug,测试通过
parent
008422b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
main
build/main
+0
-0
mqtt_verify.c
src/mqtt_verify.c
+8
-4
gpio_pwm_car0104.c
system/gpio/gpio_pwm_car0104.c
+4
-6
No files found.
build/main
View file @
ab37bba1
No preview for this file type
src/mqtt_verify.c
View file @
ab37bba1
...
...
@@ -17,7 +17,8 @@ int gverify_count =12000;//判断是否有一分钟
char
only_id_middle
[
11
];
char
secret_key
[
256
];
//存储上一次的topic
char
secret_key
[
1024
];
//存储上一次的topic
bool
secret_key_index
=
TRUE
;
//用于判断是否对比topic
int
gverify_index
=
0
;
//判断是否验证成功
...
...
@@ -52,6 +53,8 @@ int send_jwtser(const char *token){
char
*
only_Id
=
generate_random_id
();
my_zlog_debug
(
"%s"
,
only_Id
);
strcpy
(
only_id_middle
,
only_Id
);
cJSON_AddStringToObject
(
body
,
"data"
,
token
);
//为0成功
...
...
@@ -97,13 +100,12 @@ int receive_jwt(cJSON *body) {
pthread_mutex_unlock
(
&
gverify_mutex
);
my_zlog_notice
(
"topic不同,验证完成"
);
}
}
if
(
secret_key_index
==
TRUE
)
{
}
else
{
strcpy
(
secret_key
,
token
);
secret_key_index
=
FALSE
;
}
unsigned
long
long
token_time_s
=
strtoull
(
token_time
,
NULL
,
10
);
// 转换为秒级时间戳
...
...
@@ -122,10 +124,12 @@ int receive_jwt(cJSON *body) {
my_zlog_debug
(
"在有效期内"
);
pthread_mutex_lock
(
&
gverify_mutex
);
gverify_count
=
0
;
my_zlog_info
(
"count: %s"
,
gverify_count
);
pthread_mutex_unlock
(
&
gverify_mutex
);
my_zlog_debug
(
"gverify_count=%d"
,
gverify_count
);
}
}
else
{
my_zlog_debug
(
"不在有效期内"
);
gverify_index
=
1
;
my_zlog_debug
(
"gverify_index= %d "
,
gverify_index
);
}
...
...
system/gpio/gpio_pwm_car0104.c
View file @
ab37bba1
...
...
@@ -174,15 +174,13 @@ int car0104_change(unsigned char *buf) {
unsigned
char
val
=
buf
[
2
];
if
(
mode
==
1
)
{
//mode_lift_flont(val);
car0104_flont
(
val
+
45
);
car0104_flont
(
val
);
}
else
if
(
mode
==
2
)
{
//mode_lift_back(val);
car0104_back
(
val
+
45
);
car0104_back
(
val
);
}
else
if
(
mode
==
3
)
{
car0104_lift
(
val
+
15
);
car0104_lift
(
val
+
20
);
}
else
if
(
mode
==
4
)
{
car0104_right
(
val
+
15
);
car0104_right
(
val
+
20
);
}
}
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