Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pg_gps
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
1
Merge Requests
1
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
957dd
pg_gps
Commits
0564d92d
Commit
0564d92d
authored
Sep 19, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将QOS改为了0
parent
875731fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
3 additions
and
5 deletions
+3
-5
compiler_depend.internal
build/CMakeFiles/main.dir/compiler_depend.internal
+0
-0
compiler_depend.make
build/CMakeFiles/main.dir/compiler_depend.make
+0
-0
main.cc.o
build/CMakeFiles/main.dir/src/main.cc.o
+0
-0
mqtt_used.cc.o
build/CMakeFiles/main.dir/src/mqtt_used.cc.o
+0
-0
main
build/main
+0
-0
mqtt_controller.hpp
include/mqtt_controller.hpp
+1
-1
mqtt_used.hpp
include/mqtt_used.hpp
+1
-1
main.cc
src/main.cc
+0
-2
mqtt_used.cc
src/mqtt_used.cc
+1
-1
No files found.
build/CMakeFiles/main.dir/compiler_depend.internal
View file @
0564d92d
This diff is collapsed.
Click to expand it.
build/CMakeFiles/main.dir/compiler_depend.make
View file @
0564d92d
This diff is collapsed.
Click to expand it.
build/CMakeFiles/main.dir/src/main.cc.o
View file @
0564d92d
No preview for this file type
build/CMakeFiles/main.dir/src/mqtt_used.cc.o
View file @
0564d92d
No preview for this file type
build/main
View file @
0564d92d
No preview for this file type
include/mqtt_controller.hpp
View file @
0564d92d
...
...
@@ -54,7 +54,7 @@ public:
void
unsubscribe
(
const
std
::
string
&
topic
);
// 发布消息
void
publish
(
const
std
::
string
&
topic
,
const
std
::
string
&
payload
,
int
qos
=
1
,
bool
retained
=
false
);
void
publish
(
const
std
::
string
&
topic
,
const
std
::
string
&
payload
,
int
qos
=
0
,
bool
retained
=
false
);
private
:
// 内部类,用于处理来自Paho库的回调
...
...
include/mqtt_used.hpp
View file @
0564d92d
...
...
@@ -22,7 +22,7 @@ public:
void
AddSubscription
(
const
std
::
string
&
topic
,
SimpleJsonCallback
callback
);
void
AddSubscriptions
(
const
std
::
vector
<
std
::
string
>&
topics
,
SimpleJsonCallback
common_callback
);
void
RemoveSubscription
(
const
std
::
string
&
topic
);
void
PublishJson
(
const
std
::
string
&
topic
,
const
nlohmann
::
json
&
json_payload
,
int
qos
=
1
,
bool
retained
=
false
);
void
PublishJson
(
const
std
::
string
&
topic
,
const
nlohmann
::
json
&
json_payload
,
int
qos
=
0
,
bool
retained
=
false
);
private
:
// 将订阅请求封装成一个任务
...
...
src/main.cc
View file @
0564d92d
...
...
@@ -27,8 +27,6 @@ const std::string publish_topic_prefix = "positioning/"; // 发布数据的主
std
::
string
final_publish_topic
;
std
::
string
g_device_id
;
NetworkInfo
g_network_addr
;
positioningMapData
g_positioning_data_t
;
...
...
src/mqtt_used.cc
View file @
0564d92d
...
...
@@ -71,7 +71,7 @@ void MqttTopicsHandler::AddSubscription(const std::string& topic, JsonCallback c
post_task
([
this
,
topic
,
wrapped_callback
]()
{
std
::
cout
<<
"工作线程:正在执行订阅主题: "
<<
topic
<<
std
::
endl
;
// 假设 QoS 为 1
subscribe
(
topic
,
1
,
wrapped_callback
);
subscribe
(
topic
,
0
,
wrapped_callback
);
});
}
...
...
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