Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-imgsrv
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-imgsrv
Commits
7b0fd0dd
Commit
7b0fd0dd
authored
Jun 06, 2022
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added reboot command
parent
68776360
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
imgsrv.c
src/imgsrv.c
+13
-0
No files found.
src/imgsrv.c
View file @
7b0fd0dd
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
#include <elphel/x393_devices.h>
#include <elphel/x393_devices.h>
#include <byteswap.h>
#include <byteswap.h>
#include <sys/reboot.h>
// change to 0 when done
// change to 0 when done
#define ELPHEL_DEBUG 0
#define ELPHEL_DEBUG 0
#if ELPHEL_DEBUG
#if ELPHEL_DEBUG
...
@@ -198,6 +201,7 @@ const char url_args[] = "This server supports sequence of commands entered in th
...
@@ -198,6 +201,7 @@ const char url_args[] = "This server supports sequence of commands entered in th
" No effect on free-running or
\"
slave
\"
cameras, so it is OK to send it to all.
\n
"
" No effect on free-running or
\"
slave
\"
cameras, so it is OK to send it to all.
\n
"
"timestamp_name - format file name as <seconds>_<useconds>_<channel>.<ext>
\n
"
"timestamp_name - format file name as <seconds>_<useconds>_<channel>.<ext>
\n
"
"bchn[n]- base channel = n, <channel> = n + port number (0-3) - for unique naming of multicamera systems.
\n
"
"bchn[n]- base channel = n, <channel> = n + port number (0-3) - for unique naming of multicamera systems.
\n
"
"reboot - reboot system (useful when all php-cgi instances are stuck).
\n
"
"
\n
"
"
\n
"
"tiff_* commands to preview 16-bit TIFF files as 8-bit indexed BMP ones (always buffered), they should be inserted before /bimg)
\n
"
"tiff_* commands to preview 16-bit TIFF files as 8-bit indexed BMP ones (always buffered), they should be inserted before /bimg)
\n
"
"tiff_convert - enable conversion, replace TIFF with BMP
\n
"
"tiff_convert - enable conversion, replace TIFF with BMP
\n
"
...
@@ -2430,6 +2434,15 @@ void listener_loop(struct file_set *fset)
...
@@ -2430,6 +2434,15 @@ void listener_loop(struct file_set *fset)
fprintf
(
stderr
,
"Retriggering camera : lseek 0x%x, SEEK_END
\n
"
,
LSEEK_DMA_INIT
);
fprintf
(
stderr
,
"Retriggering camera : lseek 0x%x, SEEK_END
\n
"
,
LSEEK_DMA_INIT
);
}
else
if
(
strcmp
(
cp1
,
"favicon.ico"
)
==
0
)
{
}
else
if
(
strcmp
(
cp1
,
"favicon.ico"
)
==
0
)
{
// ignore silently - for now, later make an icon?
// ignore silently - for now, later make an icon?
}
else
if
(
strcmp
(
cp1
,
"reboot"
)
==
0
)
{
// Try to send response before dying
if
(
sent2socket
<=
0
)
{
// Nothing was sent to the client so far and the command line is over. Let's return 1x1 pixel gif
metaXML
(
fset
,
0
);
}
metaXML
(
fset
,
2
);
// 0 - new (send headers), 1 - continue, 2 - finish
fflush
(
stdout
);
// probably it is not needed anymore, just in case
sync
();
reboot
(
RB_AUTOBOOT
);
}
else
{
}
else
{
if
(
cp1
[
0
]
!=
'_'
)
fprintf
(
stderr
,
"Unrecognized URL command:
\"
%s
\"
- ignoring
\n
"
,
cp1
);
// allow "&_time=..." be silently ignored - needed for javascript image reload
if
(
cp1
[
0
]
!=
'_'
)
fprintf
(
stderr
,
"Unrecognized URL command:
\"
%s
\"
- ignoring
\n
"
,
cp1
);
// allow "&_time=..." be silently ignored - needed for javascript image reload
}
}
...
...
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