Conversation
l implementation. For development details look at the ECUEmulator Repo(48081e45)
miDeb
left a comment
There was a problem hiding this comment.
Looks good, just a few questions
| par_count: 5, | ||
| firmware_hash: 1234, | ||
| liquid_hash: 5678, | ||
| device_name: [0xAA; 53], |
There was a problem hiding this comment.
I guess it's irrelevant for this test, but this would not be a valid payload due to 0xaa not being valid ascii and the string not being null terminated. Would that be handled at a higher level? What do we do if we encounter an invalid message?
There was a problem hiding this comment.
Good point. I'd say that invalid messages trigger an Error Message being sent to the server => but nothing else happens .
For the string: I don't really know how to easily enforce this on a type level. We would need to have to restrict the size and the null termination
|
I noticed another issue: Is there a way to easily fix this in your macro? Probably not, right? Especially since we don't always know the type when sending data. Some ideas I have:
Do you have some time to work on this? @miDeb I'm a bit busy then next few days |
So you're saying for e.g. From an implementation standpoint I believe I can think of a way to implement this in the macro; basicallly one way or another we'll have to know what data type we are serializing and then only output a certain length depending on that. For deserializing we then don't know the data type (unless it is passed in from outside) so we'd just produce a byte array again. If you want I can update the protocol spec to make I guess similar arguments could be made about the An idea I just had (though not sure if I'm a fan of it, just wanted to mention it here): We could simply specify that trailing null bytes may be omitted when sending, and incoming messages are padded with null bytes if needed. But maybe that would hinder us in detecting faulty messages? Let me know what you think. |
|
In my mind I always wanted the parameter/telemetry values to only be a maximum of 61/62 bytes, and not always that long. But you are right that I didn't correctly specify this. My bad! Actually this also goes for the Telemetry* and Status messages...
Yes please that would be great. I agree with you that this would also make sense for the Telemetry* and the String messages. Especially since we'll be sending looots of TelemetryUpdates.
That's not a bad Idea. Obviously the other approach is cleaner. It might have a slight impact on faulty messages, but CAN already has a CRC, so I think we would detect faulty messages through that already. Another downside is some overhead on both ends and that we might miss some issue which fucks us later on. Thank you so much for the work! |
Added the rust liquidCAN protocol implementation. For development details look at the ECUEmulator Repo (commit 48081e45)