-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Information about presentation types. #37
Comments
Hi prj, That looks right, and also explains why enums require EnumType_1E to be zero. |
The little time and effort spent here is nothing compared to the task you have accomplished. Another thing that might be useful to look at is how floats are encoded. Considering that for example CR61 is available as both cbf and srmd (and because it's newer, most likely it contains some floats) it might be possible to dump data from both srmd (via dts APIS) and via your tool, and then look at the flags that are set if there is a float datatype. Unfortunately it is not possible to determine the source datatype via dts APIS for Caesar, as they throw an error - seems like the dts API was made with purely srmd in mind. I'll update this if I get around to it. P.S. |
As far as I understand, floats and decimal values are expressed in Caesar as a SCALE type, which contain an additional multiply and add parameters. This was briefly discussed in #1 (reply in thread) , and it may be what you are looking for. Thanks again for the extra knowledge on the CVN, especially with the details on collisions. Learning from folks like you makes working on this project worthwhile. |
I think you misunderstood what I meant. In the ASAM MCD world there is the Coded Type and the Physical Type. The Coded Type is what comes from the ECU and the Physical Type is the type after conversion.
Plus I assign A_ASCIISTRING or A_BYTEFIELD if it's ascii dump or hex dump type respectively. However, this approach does not leave room for floats as the coded type. For example in the MRD1 srm-d "Ams_Mp" is an IEEE Float. I will try to find an overlapping SRMD and CBF, and see if I can find what flags are set if it's a float type. CR43 so far did not yield any floats nor did CR61. It is of course possible that Caesar does not even support floats as input type, who knows. P.S. Regarding the CVN, because the tester requests this from the ECU you can always just patch the code for the DID to always return a fixed number of your choosing. Meaning - read the original CVN, do your manipulations and then force return the original CVN by storing it in the flash and playing it back instead of returning the actually calculated value. In that case the algorithm is completely irrelevant... |
I managed to find a float. MED40.cbf, variant VC22_Star2_3 DescriptionString "IDENTICAL FLOAT DEC 4 Bytes 32 1" In your code:
If I put a breakpoint here, the only time it ever triggers is when I hit a float. |
Nice! I've added your contributions and there should now be experimental support for IEEE 32-bit floats. The implementation assumes that the floats are in big-endian like the integer values. My MED40 files are a bit dated (last variant is VC15) and I don't have a compatible target, so I might to depend on community feedback if this works properly. Also thanks for the other CVN fun fact, seems like the mechanism is fundamentally broken :^) |
As far as I can see all ECUs are MSB first. I did not find a way (yet?) to query this from the DTS MCD kernel, so for now I am just assuming that Daimler does not use this. ASAM-MCD has much more complicated data parsing. Caesar works differently, especially regarding byte and bit extraction. |
Another thing that came to my mind. You have it set that an EnumType must not have the signed bit set. My approach was like this:
Maybe generalizing a little, but seems to work out fine for me so far. |
Your approach looks good and is an improvement over the existing implementation. It might potentially fix some of the prior hacks that were used to adjust the data types too. I might not be able to fix this up that quickly, so if at any time you would like to make a pull request, please let me know and I would be glad to work on merging your PR in. |
I could make some changes to Caesar, but then I am worried it could break Diogenes and I have no idea how that works (nor am I too interested in the UI, I am mostly here for the data...) |
Sure, changes to Caesar would be excellent. Don't worry about breaking Diogenes, I'll adjust your changes to fit :) |
OK, will put aside some time and make some modifications to the presentation parsing. On another note, I tried sending you an e-mail on a domain that has something to do with lost mammals, but never received a reply. Is there some way I can contact you? |
Unk1F if 1 means the data is LoHi. If not set, HiLo. |
Thanks! Updated in c9ec0d2 |
EnumType_1E is actually the sign bit.
In this example the EnumType_1E is in 2nd position:
Types cross-referenced from A2L are at end of row. I checked with a rather large sample set and it seems to agree.
The text was updated successfully, but these errors were encountered: