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
09dce424
Commit
09dce424
authored
Jul 29, 2025
by
学习的菜鸟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决了mqtt不上报的bug
parent
e29952ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
pthread_open.c
app/main/pthread_open.c
+6
-3
main
build/main
+0
-0
No files found.
app/main/pthread_open.c
View file @
09dce424
...
...
@@ -49,14 +49,14 @@ void *thread_exit_time(void *arg) {
pthread_mutex_lock
(
&
g_exit_count_mutex
);
g_devcontrol_exit_count
++
;
pthread_mutex_lock
(
&
g_exit_count_mutex
);
if
(
g_devcontrol_exit_count
>=
5
)
{
device_stop
(
g_device_type
);
pthread_mutex_lock
(
&
g_exit_count_mutex
);
g_devcontrol_exit_count
=
6
;
pthread_mutex_unlock
(
&
g_exit_count_mutex
);
}
pthread_mutex_unlock
(
&
g_exit_count_mutex
);
}
return
NULL
;
}
...
...
@@ -95,6 +95,7 @@ void *thread_open_browser(void *arg) {
//mqtt异常处理,断开自动重连,简单粗暴
void
*
thread_mqtt_reconnect
(
void
*
arg
)
{
if
(
mqtt_init
()
!=
0
)
{
my_zlog_fatal
(
"mqtt_init failed"
);
return
NULL
;
...
...
@@ -111,6 +112,7 @@ void *thread_mqtt_reconnect(void *arg) {
g_mqtt_grc
=
mqtt_create
(
mosq
);
if
(
g_mqtt_grc
!=
0
)
{
my_zlog_warn
(
"mqtt fail ..."
);
mqtt_clean
(
mosq
);
mosq
=
NULL
;
continue
;
...
...
@@ -118,6 +120,7 @@ void *thread_mqtt_reconnect(void *arg) {
g_mqtt_grc
=
mqtt_cycle
(
mosq
);
// 阻塞直到断开
if
(
g_mqtt_grc
!=
0
){
my_zlog_warn
(
"mqtt fail ..."
);
mqtt_clean
(
mosq
);
mosq
=
NULL
;
}
...
...
build/main
View file @
09dce424
No preview for this file type
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