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
fd4a4ed6
Commit
fd4a4ed6
authored
Mar 07, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
f62b390d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
imgsrv.c
src/imgsrv.c
+24
-0
No files found.
src/imgsrv.c
View file @
fd4a4ed6
...
@@ -174,6 +174,9 @@ const char url_args[] = "This server supports sequence of commands entered in th
...
@@ -174,6 +174,9 @@ 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 - use <seconds>_<useconds>_<channel>.<ext> as a file name"
;
"timestamp_name - use <seconds>_<useconds>_<channel>.<ext> as a file name"
;
// path to file containing serial number
static
const
char
path_to_serial
[]
=
"/sys/devices/soc0/elphel393-init/serial"
;
int
sendImage
(
struct
file_set
*
fset
,
int
bufferImageData
,
int
use_Exif
,
int
saveImage
);
int
sendImage
(
struct
file_set
*
fset
,
int
bufferImageData
,
int
use_Exif
,
int
saveImage
);
void
sendBuffer
(
void
*
buffer
,
int
len
);
void
sendBuffer
(
void
*
buffer
,
int
len
);
void
listener_loop
(
struct
file_set
*
fset
);
void
listener_loop
(
struct
file_set
*
fset
);
...
@@ -190,6 +193,21 @@ unsigned long getCurrentFrameNumberCompressor( struct file_set *fset);
...
@@ -190,6 +193,21 @@ unsigned long getCurrentFrameNumberCompressor( struct file_set *fset);
/** @brief Read no more then 255 bytes from file */
/** @brief Read no more then 255 bytes from file */
#define saferead255(f, d, l) read(f, d, ((l) < 256) ? (l) : 255)
#define saferead255(f, d, l) read(f, d, ((l) < 256) ? (l) : 255)
/**
* @brief read Camera Serial Number from SysFS
* @param[in] filename file path
* @param[in] serial pointer to buffer
* @return 0 if data was extracted successfully and negative error code otherwise
*/
int
readCameraSerialNumberFromSysFS
(
char
*
path
,
char
*
serial
){
int
fd
;
fd
=
open
(
path
,
O_RDONLY
);
if
(
fd
<
0
)
return
-
1
;
read
(
fd
,
serial
,
sizeof
(
serial
));
close
(
fd
);
return
0
;
}
/**
/**
* @brief Print Exif data in XML format to @e stdout
* @brief Print Exif data in XML format to @e stdout
* @param[in] exif_page page number in Exif buffer
* @param[in] exif_page page number in Exif buffer
...
@@ -256,6 +274,7 @@ int printExifXML(int exif_page, struct file_set *fset)
...
@@ -256,6 +274,7 @@ int printExifXML(int exif_page, struct file_set *fset)
int
hours
=
0
,
minutes
=
0
;
int
hours
=
0
,
minutes
=
0
;
double
seconds
=
0
.
0
;
double
seconds
=
0
.
0
;
double
longitude
=
0
.
0
,
latitude
=
0
.
0
,
altitude
=
0
.
0
,
heading
=
0
.
0
,
roll
=
0
.
0
,
pitch
=
0
.
0
,
exposure
=
0
.
0
;
double
longitude
=
0
.
0
,
latitude
=
0
.
0
,
altitude
=
0
.
0
,
heading
=
0
.
0
,
roll
=
0
.
0
,
pitch
=
0
.
0
,
exposure
=
0
.
0
;
const
char
CameraSerialNumber
[]
=
"FFFFFFFFFFFF"
;
val
[
255
]
=
'\0'
;
val
[
255
]
=
'\0'
;
// int fd_exif = open(fset->exif_dev_name, O_RDONLY);
// int fd_exif = open(fset->exif_dev_name, O_RDONLY);
if
(
fset
->
exif_dev_fd
<
0
)
if
(
fset
->
exif_dev_fd
<
0
)
...
@@ -275,6 +294,11 @@ int printExifXML(int exif_page, struct file_set *fset)
...
@@ -275,6 +294,11 @@ int printExifXML(int exif_page, struct file_set *fset)
fset
->
exif_dev_fd
=
-
1
;
fset
->
exif_dev_fd
=
-
1
;
return
-
1
;
// Error opening Exif
return
-
1
;
// Error opening Exif
}
}
// Camera Serial Number
readCameraSerialNumberFromSysFS
(
&
path_to_serial
,
CameraSerialNumber
);
printf
(
"<CameraSerialNumber>
\"
%s
\"
</CameraSerialNumber>
\n
"
,
CameraSerialNumber
);
printf
(
"<CameraSerialNamber2>
\"
FFFFFFFFFFFF
\"
</CameraSerialNamber2>
\n
"
);
// Image Description
// Image Description
if
(
exif_dir
[
Exif_Image_ImageDescription_Index
].
ltag
==
Exif_Image_ImageDescription
)
{
// Exif_Image_ImageDescription is present in template
if
(
exif_dir
[
Exif_Image_ImageDescription_Index
].
ltag
==
Exif_Image_ImageDescription
)
{
// Exif_Image_ImageDescription is present in template
lseek
(
fset
->
exif_dev_fd
,
lseek
(
fset
->
exif_dev_fd
,
...
...
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