Reverse engineering and bitmasking confusion.
Posted: Tue Feb 07, 2017 5:15 am
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,
Offset=0
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
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,
Offset=0
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