From 3d8d5da999264595c7fecc786c101b40573689df Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 27 Jan 2012 17:36:42 -0800 Subject: [PATCH] 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 --- cochran.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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); -- 2.43.0