From: Linus Torvalds Date: Sat, 28 Jan 2012 01:36:42 +0000 (-0800) Subject: Fix up Cochran dive header decoding offset X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3d8d5da999264595c7fecc786c101b40573689df;p=ext%2Fsubsurface.git Fix up Cochran dive header decoding offset It turns out the odd "different CAN files have different header offsets" came from the fact that the decode block was different lengths, and I had not picked the correct place to start - and instead had found two different places that were at different offsets due to the decode block length differences. This fixes that up, and it looks like the dive header is correctly descrambled (but what the data *means* is unclear, although there is now an ASCII date and time visible, so at least one part of it is pretty obvious). The actual dive data unscrambling is still different for the two test-files I have to play with, I do not know why. Signed-off-by: Linus Torvalds --- diff --git a/cochran.c b/cochran.c index 650a479..ce42c31 100644 --- a/cochran.c +++ b/cochran.c @@ -135,11 +135,7 @@ static void parse_cochran_header(const char *filename, * The header scrambling is different form the dive * scrambling. Oh yay! */ -#if 0 // Alex - partial_decode(0x058c, 0x0b14, decode, 0, mod, in, size, buf); -#else // Don - partial_decode(0x05a0, 0x0b14, decode, 0, mod, in, size, buf); -#endif + partial_decode(0x010e, 0x0b14, decode, 0, mod, in, size, buf); partial_decode(0x0b14, 0x1b14, decode, 0, mod, in, size, buf); partial_decode(0x1b14, 0x2b14, decode, 0, mod, in, size, buf); partial_decode(0x2b14, 0x3b14, decode, 0, mod, in, size, buf);