Skip to content
GitLab
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
9486c1c6
Commit
9486c1c6
authored
Oct 26, 2018
by
Achim Morschhauser
Browse files
Data Checksum in binary mode
parent
19c38b28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
9486c1c6
...
...
@@ -19,7 +19,7 @@ CCFLAGS=-g -lrt -std=c++11 -pthread
EXCL
=
driver_serial_emulate.o
# Uncomment to use virtual serial port. Run 'make clean all' afterwards
EXCL
=
driver_serial.o
#
EXCL=driver_serial.o
.SECONDARY
:
...
...
src/driver_obs_obsdaq.cpp
View file @
9486c1c6
...
...
@@ -806,15 +806,16 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
}
}
// Check c
ontrol bit
// Check c
hecksum byte
tmp_d
=
0
;
// Sum over N-1 data bytes
for
(
int
i
=
0
;
i
<
reclen
-
1
;
i
++
){
tmp_d
+=
buf
[
i
];
}
// Last byte must contain sum of last (N-1) bytes in bits 0-6
if
(
(
tmp_d
&
127
)
!=
(
buf
[
reclen
-
1
]
&
127
)
){
fprintf
(
stderr
,
"Faulty data: Control sum check failed for "
);
for
(
int
i
=
0
;
i
<
strlen
(
buf
)
;
i
++
){
for
(
int
i
=
0
;
i
<
reclen
-
1
;
i
++
){
fprintf
(
stderr
,
"%d "
,
buf
[
i
]);
}
fprintf
(
stderr
,
"and values %d %d %d.
\n
"
,
...
...
usr/parameters.par
View file @
9486c1c6
# Baudrate for ObsDAQ
BAUD=19200 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB
1
PORT=/dev/ttyUSB
0
# Resistance of variometer
R=1.0
# Scale values of variometer
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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