paulhibbing / AGread

Read Accelerometer Files from ActiGraph Accelerometers
Other
15 stars 4 forks source link

Allow dev parser to accommodate failed checksums #30

Closed paulhibbing closed 3 years ago

paulhibbing commented 3 years ago

Currently, read_gt3x throws an error if it encounters a bad packet. It is not safe to assume that all packets are good, although bad packets are rare. This fix returns NULL for bad packets, and then fills in values by latching to the end of the previous packet. A message is issued concerning the total number of bad packets. A warning would be preferable, but the gt3x filename is not accessible within the log.bin parsing functions. It seems a waste to pass a new argument around just for the sake of a warning message that will rarely be used, so for now the message is in place. It is not tied to verbose (i.e., it will print regardless), but it may make sense to do that in the future. For now, I like to know if anything unusual is going on, no matter what.