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
07e6627a
Commit
07e6627a
authored
Dec 19, 2024
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell bug update and join opensh pthread
parent
3384b318
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
7 deletions
+22
-7
cam.sh
cam.sh
+3
-3
log.txt
log/log.txt
+0
-0
main
main
+0
-0
main.c
main.c
+8
-2
main.h
main.h
+11
-2
No files found.
cam.sh
View file @
07e6627a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
pkill firefox
pkill firefox
# 设置 DISPLAY 环境变量(确保 Firefox 能运行图形界面)
# 设置 DISPLAY 环境变量(确保 Firefox 能运行图形界面)
--new-window
export
DISPLAY
=
:0
export
DISPLAY
=
:0
sudo
firefox
--new-window
"https://8.129.3.163/index"
--ignore-certificate-errors
&
sudo
firefox
"https://8.129.3.163/index"
--ignore-certificate-errors
\ No newline at end of file
\ No newline at end of file
log/log.txt
View file @
07e6627a
This diff is collapsed.
Click to expand it.
main
View file @
07e6627a
No preview for this file type
main.c
View file @
07e6627a
...
@@ -5,6 +5,12 @@
...
@@ -5,6 +5,12 @@
#include "delay.h"
#include "delay.h"
#include "opensh.h"
#include "opensh.h"
void
*
opensh
(
void
*
arg
)
{
sleep
(
10
);
opencamsh
();
return
NULL
;
}
void
*
serial_usart1
(
void
*
arg
)
void
*
serial_usart1
(
void
*
arg
)
{
{
...
@@ -82,9 +88,9 @@ int main(int argc, char *argv[]) {
...
@@ -82,9 +88,9 @@ int main(int argc, char *argv[]) {
ipaddr
();
//获取ip
ipaddr
();
//获取ip
mqtt_wirte
();
//mqtt心跳首次发送
mqtt_wirte
();
//mqtt心跳首次发送
opencamsh
();
//
opencamsh();
thread_start
(
serial_usart1
,
AppExit
,
Mqttbeat
,
serial_usart2
);
thread_start
(
serial_usart1
,
AppExit
,
Mqttbeat
,
serial_usart2
,
opensh
);
mqtt_cycle
(
mosq
);
mqtt_cycle
(
mosq
);
...
...
main.h
View file @
07e6627a
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
#include "serial.h"
#include "serial.h"
#include "delay.h"
#include "delay.h"
pthread_t
thread
[
4
];
pthread_t
thread
[
5
];
int
thread_start
(
void
*
serial_usart1
(
void
*
arg
),
void
*
AppExit
(
void
*
arg
),
void
*
Mqttbeat
(
void
*
arg
),
void
*
serial_usart2
(
void
*
arg
))
int
thread_start
(
void
*
serial_usart1
(
void
*
arg
),
void
*
AppExit
(
void
*
arg
),
void
*
Mqttbeat
(
void
*
arg
),
void
*
serial_usart2
(
void
*
arg
)
,
void
*
opensh
(
void
*
arg
)
)
{
{
...
@@ -38,6 +38,12 @@ int thread_start(void *serial_usart1(void *arg),void *AppExit(void *arg),void *M
...
@@ -38,6 +38,12 @@ int thread_start(void *serial_usart1(void *arg),void *AppExit(void *arg),void *M
perror
(
"Failed to create thread 1"
);
perror
(
"Failed to create thread 1"
);
return
4
;
return
4
;
}
}
if
(
pthread_create
(
&
thread
[
4
],
NULL
,
opensh
,
NULL
)
!=
0
)
{
perror
(
"Failed to create thread 1"
);
return
5
;
}
}
}
void
thread_end
()
void
thread_end
()
...
@@ -52,6 +58,8 @@ void thread_end()
...
@@ -52,6 +58,8 @@ void thread_end()
pthread_join
(
thread
[
2
],
NULL
);
pthread_join
(
thread
[
2
],
NULL
);
pthread_join
(
thread
[
3
],
NULL
);
pthread_join
(
thread
[
3
],
NULL
);
pthread_join
(
thread
[
4
],
NULL
);
}
}
#endif
#endif
\ No newline at end of file
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