Page 1 of 1

Reverse engineering and bitmasking confusion.

Posted: Tue Feb 07, 2017 5:15 am
by Mitch Detailed
I'm trying to get a solid understanding of how to apply a bitmask to read variables within bytes of information on the bus. The platform is a w211 E55 AMG, and there's quite a bit of information offset/requiring a bitmask and odd length in bits.

I figure i'd set up a real example in hopes of assistance.

Can Id= 0x236 (566)
Information is in the first 2 bytes, So:
Length=2 and,
The Variable inside the 2 bytes is xxx##### ######xx, So:
Bitmask= 0x1FFC

Steering Wheel Centerline value =1024,
Locked Left value= 776
Locked Right value = 1272

run the variable through the formula x*1/8+-128,

you get a min/max of -31 and 31

Thanks in advance - Mitch

Posted: Tue Feb 07, 2017 5:46 pm
by brentp
Hi Mitch,

Our next-gen CAN bus support should handle the things you'll need. Demo video here:

These new mapping capabilities should handle nearly all use cases; for things that fall through, you'll still be able to map channels in Lua, where you'll be able to apply arbitrary logic, bitmasks using Lua's bitop libraries, complex formulas and algorithms and so on.

Hope this helps!