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
67c0da26
Commit
67c0da26
authored
Jan 02, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update main
parent
0666a530
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
main
main
+0
-0
main.c
main.c
+10
-1
mqtt.c
mqtt.c
+5
-0
mqtt.h
mqtt.h
+3
-3
No files found.
main
View file @
67c0da26
No preview for this file type
main.c
View file @
67c0da26
...
@@ -102,6 +102,14 @@ void *Mqtt_onnect(void *arg)
...
@@ -102,6 +102,14 @@ void *Mqtt_onnect(void *arg)
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>=
4
)
{
TOPIC
=
argv
[
1
];
TOPIC2
=
argv
[
2
];
TOPIC3
=
argv
[
3
];
printf
(
"%s,%s,%s
\n
"
,
TOPIC
,
TOPIC2
,
TOPIC3
);
}
system
(
"pkill firefox"
);
system
(
"pkill firefox"
);
Delay_Ms
(
20
,
0
);
Delay_Ms
(
20
,
0
);
reconnect_4g
();
reconnect_4g
();
...
@@ -115,8 +123,9 @@ int main(int argc, char *argv[]) {
...
@@ -115,8 +123,9 @@ int main(int argc, char *argv[]) {
ipaddr
();
//获取ip
ipaddr
();
//获取ip
//mosquitto_publish(mosq, NULL, "macmqtt", strlen(TOPIC), TOPIC, 0, false);
//mosquitto_publish(mosq, NULL, "macmqtt", strlen(TOPIC), TOPIC, 0, false);
//Delay_Ms(10,0);
//Delay_Ms(10,0);
thread_start
(
serial_usart1
,
AppExit
,
Mqttbeat
,
serial_usart2
,
opensh
,
Mqtt_onnect
);
thread_start
(
serial_usart1
,
AppExit
,
Mqttbeat
,
serial_usart2
,
opensh
,
Mqtt_onnect
);
//mqtt_cycle(mosq);
//mqtt_cycle(mosq);
...
...
mqtt.c
View file @
67c0da26
#include "mqtt.h"
#include "mqtt.h"
#include "gps.h"
#include "gps.h"
#include "opensh.h"
#include "opensh.h"
char
*
TOPIC
=
NULL
;
//="app2dev/controlcar0004"
char
*
TOPIC2
=
NULL
;
//="dev2app/controlcar0004"
char
*
TOPIC3
=
NULL
;
//= "controlcar0004"
time_t
gStart
;
time_t
gStart
;
...
...
mqtt.h
View file @
67c0da26
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
#define BROKER_ADDRESS "119.45.167.177"
#define BROKER_ADDRESS "119.45.167.177"
#define BROKER_PORT 1883
#define BROKER_PORT 1883
#define TOPIC "app2dev/controlcar0003
"
extern
char
*
TOPIC
;
//="app2dev/controlcar0004
"
#define TOPIC2 "dev2app/controlcar0003
"
extern
char
*
TOPIC2
;
//="dev2app/controlcar0004
"
#define TOPIC3 "controlcar0003
"
extern
char
*
TOPIC3
;
//= "controlcar0004
"
#define USERNAME "admin" // 替换为你的用户名
#define USERNAME "admin" // 替换为你的用户名
#define PASSWORD "admin" // 替换为你的密码
#define PASSWORD "admin" // 替换为你的密码
...
...
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