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
6d565a90
Commit
6d565a90
authored
Jun 06, 2025
by
学习的菜鸟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入mqtt切网络需要测试
parent
6d5a6a99
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
7 deletions
+14
-7
version.h
build/include/version.h
+1
-1
main
build/main
+0
-0
wifichange.h
include/wifichange.h
+5
-4
mqtt.c
src/mqtt.c
+5
-1
thread_main.c
src/thread_main.c
+3
-1
wifichange.c
src/wifichange.c
+0
-0
No files found.
build/include/version.h
View file @
6d565a90
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
#define PROJECT_VERSION_MINOR 1
#define PROJECT_VERSION_MINOR 1
#define PROJECT_VERSION_PATCH 7
#define PROJECT_VERSION_PATCH 7
#define GIT_HASH ""
#define GIT_HASH ""
#define BUILD_TIMESTAMP "2025-06-0
5T10:05:06
"
#define BUILD_TIMESTAMP "2025-06-0
6T09:12:32
"
#define BUILD_USER "orangepi"
#define BUILD_USER "orangepi"
build/main
View file @
6d565a90
No preview for this file type
include/wifichange.h
View file @
6d565a90
...
@@ -6,10 +6,11 @@
...
@@ -6,10 +6,11 @@
#define CMD_BUFFER_SIZE 256
#define CMD_BUFFER_SIZE 256
#define MAX_WIFI_LIST 100
#define MAX_WIFI_LIST 100
#define default_SSID
jking
#define default_SSID
"jking"
#define default_password
12345678
#define default_password
"12345678"
#define WIFI_CONF_PATH "/home/orangepi/car/master/device_wifi.conf"
#define WIFI_CONF_PATH "/home/orangepi/car/master/device_wifi.conf"
#define WIFI_CONF_DIR "/home/orangepi/car/master"
typedef
struct
{
typedef
struct
{
char
ssid
[
SSID_MAX_LEN
];
char
ssid
[
SSID_MAX_LEN
];
...
@@ -17,6 +18,7 @@ typedef struct {
...
@@ -17,6 +18,7 @@ typedef struct {
}
wifi_info_t
;
}
wifi_info_t
;
void
scan_wifi_json
();
//显示以连接WiFi名称和周围已有的WiFi和过滤信号强度低于50的WiFi
void
scan_wifi_json
();
//显示以连接WiFi名称和周围已有的WiFi和过滤信号强度低于50的WiFi
int
wifi_change_sendmqtt_init
();
//wifi改变初始化,放在main开头,必须要等mqtt直播就绪才行
void
wifi_change_recmqtt
(
cJSON
*
body
);
//接收到修改WiFi指令
int
delete_wifi_by_ssid
(
const
char
*
ssid
);
//忘记指定的WiFi的密码
#endif
#endif
\ No newline at end of file
src/mqtt.c
View file @
6d565a90
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "judg.h"
#include "judg.h"
#include "ads1115.h"
#include "ads1115.h"
#include "audioplay.h"
#include "audioplay.h"
#include "wifichange.h"
struct
mosquitto
*
mosq
;
struct
mosquitto
*
mosq
;
...
@@ -299,8 +300,11 @@ int device_message_receive(cJSON *json){//接收到的控制设备的mqtt消息
...
@@ -299,8 +300,11 @@ int device_message_receive(cJSON *json){//接收到的控制设备的mqtt消息
my_zlog_debug
(
"进入查询WiFi"
);
my_zlog_debug
(
"进入查询WiFi"
);
break
;
break
;
case
2004
:
case
2004
:
wifi_change_recmqtt
(
body
);
my_zlog_debug
(
"进入修改WiFi"
);
break
;
break
;
case
2005
:
download_message
(
body
);
case
2005
:
download_message
(
body
);
break
;
break
;
default
:
default
:
break
;
break
;
...
...
src/thread_main.c
View file @
6d565a90
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include "common.h"
#include "common.h"
#include "device_exit.h"
#include "device_exit.h"
#include "thread_main.h"
#include "thread_main.h"
#include "wifichange.h"
pthread_t
thread
[
6
];
// 全局线程句柄数组(或传参)
pthread_t
thread
[
6
];
// 全局线程句柄数组(或传参)
...
@@ -60,7 +61,8 @@ void *AppExit(void *arg) { //出现意外自动停止
...
@@ -60,7 +61,8 @@ void *AppExit(void *arg) { //出现意外自动停止
void
*
Mqttbeat
(
void
*
arg
)
{
void
*
Mqttbeat
(
void
*
arg
)
{
//printf("Mqttbeat start\n");
//printf("Mqttbeat start\n");
my_zlog_info
(
"Mqttbeat start"
);
my_zlog_info
(
"Mqttbeat start"
);
Delay_Ms
(
15
,
0
);
Delay_Ms
(
5
,
0
);
wifi_change_sendmqtt_init
();
while
(
1
)
{
while
(
1
)
{
if
(
AppExit_pin_pwm
==
202
)
Delay_Ms
(
0
,
45
);
if
(
AppExit_pin_pwm
==
202
)
Delay_Ms
(
0
,
45
);
if
(
AppExit_pin_pwm
!=
202
)
Delay_Ms
(
0
,
100
);
if
(
AppExit_pin_pwm
!=
202
)
Delay_Ms
(
0
,
100
);
...
...
src/wifichange.c
View file @
6d565a90
This diff is collapsed.
Click to expand it.
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