I’m trying to write the XML to map the turn indicators. The car (2011 Corsa D) also has ‘comfort’ indicators - the three flash thingy, so there are two values for each side. Sniffing the HS-CAN activity, I can see the indicators toggling bits on 0x361 in the top nibble of the first byte. So:
0010 xxxx Left comfort indicator on
0100 xxxx Right comfort indicator on
0110 xxxx Left indicator ON
1000 xxxx Right indicator ON
How do I write the XML so that either comfort OR ON lights up the dashboard icon?
I have tried shifting the bits right and bitwise ANDing with the appropriate values:
<value targetId=“160” offset=“0” length=“1” units=“bit” conversion=“((V >> 4) & 2) || ((V >> 4) & 6)”>
<value targetId=“161” offset=“0” length=“1” units=“bit” conversion=“((V >> 4) & 4) || ((V >> 4) & 8)”>
but I don’t get expected behaviour. I’m guessing my syntax may be wrong.
As a side note, if anyone has a reliable source for (UK) 2011 Corsa D CAN IDs for basic stuff and/or the CAN XML for them, that would be great. I’m not bothered about the technical stuff like IAT/ AFR etc, more just like general instrument panel indicators and readings. Co-pilot just makes stuff up and there is a lot of conflicting info on the web!
Now sorted - It was because enum doesn’t return a single bit when specifying a 0 or 1, I assume it returns a byte which isn’t being recognised by the turn indicator which is expecting a boolean (0 or 1).
I don’t know if it’s possible to force enum to return a single bit, rather than a byte (or longer)
The left hand indicator worked because the bottom bit of the byte was being set
That’s how I did it in the end. However, the value returned to realdash resulted in the input value to the indicator being between 0 and 7 (3 bits), so it srill didn’t work. I had to change the input value to 0 and 1, then it all worked