Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Achim Morschhauser
GeomagLogger
Commits
302ddf4b
Commit
302ddf4b
authored
Feb 15, 2021
by
Thomas Edwards
Browse files
Minor debug printing added before branch switch
parent
6abc3aae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/driver_obs_obsdaq.cpp
View file @
302ddf4b
...
...
@@ -1025,6 +1025,17 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Check for correct length of buffer
if
(
strlen
(
buf
)
!=
reclen
){
// debug printing
time_t
timer
;
char
time_str_buffer
[
26
];
struct
tm
*
tm_info
;
timer
=
time
(
NULL
);
tm_info
=
localtime
(
&
timer
);
strftime
(
time_str_buffer
,
26
,
"[%Y-%m-%d %H:%M:%S]: "
,
tm_info
);
puts
(
time_str_buffer
);
// fprintf(stderr,time_str_buffer);
std
::
cerr
<<
time_str_buffer
;
fprintf
(
stderr
,
"Received number of bytes not consistent. "
"Expected: %d. Received: %lu
\n
"
,
reclen
,
strlen
(
buf
));
...
...
@@ -1033,6 +1044,17 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Check 7th bits
for
(
int
i
=
0
;
i
<
reclen
;
i
++
){
if
((
unsigned
char
)
buf
[
i
]
<
32
||
(
unsigned
char
)
buf
[
i
]
>
159
){
// debug printing
time_t
timer
;
char
time_str_buffer
[
26
];
struct
tm
*
tm_info
;
timer
=
time
(
NULL
);
tm_info
=
localtime
(
&
timer
);
strftime
(
time_str_buffer
,
26
,
"[%Y-%m-%d %H:%M:%S]: "
,
tm_info
);
puts
(
time_str_buffer
);
// fprintf(stderr,time_str_buffer);
std
::
cerr
<<
time_str_buffer
;
fprintf
(
stderr
,
"Faulty data: 7th bit check failed for byte "
"%d: %d.
\n
"
,
i
,(
unsigned
char
)
buf
[
i
]);
fprintf
(
stderr
,
"%d%d%d%d%d%d%d%d
\n
"
,
buf
[
i
]
&
1
,(
buf
[
i
]
&
2
)
/
2
,
...
...
Write
Preview
Supports
Markdown
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