Replies: 4 comments
-
|
There exist some project items already related to this. The MDF C++ library have a C# (.NET) interface using the C++/CLI compiler. It will only work in Windows as there is no Linux C++/CLI compiler. I have started to do a Python interface by using the pybind11 library but I don't know if I ever will finish this interface. The ASAMMDF library does a good job here only weakness on larger MDF files (>1G). My point is that it is very time consuming to do a one-to-one interface similar to the C++ interface. We have Rust, Julia and R interfaces to fix as well. The ideal solution is to rewrite the library in Rust. The C++ library took about one year full time including documentation and testing. Maybe by skipping the MDF 3 support the work could be limited to a 6 month work. Another solution is to do as you doing, a Rust wrapper around the C++ library. This is simpler but the C++ interface have around 50 interfaces objects so it's still some work to do. A third solution is to do a gRPC (protobuf) interface instead. Same work as above with defining and implement a MDF service. The good thing is that it is now works against most known languages. There exist some other solutions to the above problem by simplify the interfaces. Not so flexible but solves most applications. I'm currently working on the bus_master/bus_message_lib/metriclib together with another company. It is some sort of framework around automotive bus messages. Somewhere in the above (bus) mess there is an optimal solution. I will check your mdflib-rs repository and please return any thoughts of the above discussion. |
Beta Was this translation helpful? Give feedback.
-
|
@tuna-f1sh The CAN to MDF (Can Dump) is very similar to the Bus Master project. Interface to the bus master might be a simpler solution. The previous mentioned project item that implements a C (or Rust) library/crate, is targeted Zephyr project i.e. below the embedded Linux solutions. Making a Rust wrapper around this C-interface might be simpler. Zephyr + Rust are still have new born issues. |
Beta Was this translation helpful? Give feedback.
-
|
Yes I did write a C wrapper around the C++ library. I started by trying to use bindgen with the 'mdflibary/src/MdfExport.cpp' since I thought that would be a nice existing external API to generate against but it didn't really work and got messy. You're right that I could have used cxx at that point rather than the C wrapper but since I was already using bindgen I kept on that path. I'm also familiar with C so it was much quicker to get running than learning to use the cxx crate. The embedded project for mdflib is of high interest to me since I'm working on an embedded logger. Part of my logic of writing the Rust binding was to understand this library better to potentially help support this. I did include all the interfaces despite the fact I only needed the CAN helpers for this reason. The embedded target is still quite an undertaking and I'm still working on base system with simplistic binary logging for now but will hopefully be able to support. Let me know when you start looking into it and if you want help. |
Beta Was this translation helpful? Give feedback.
-
|
I'm currently finishing the bus master project with mainly documentation and testing. I think this will take one more month. I have skipped the Ada version of the low-level the MDF library and focus on either Rust or C. Originally the Rust language was selected as many embedded system already supports the C++ language. Currently, I'm looking to do a C interface instead. The C-language have more end-users and it is easy to maintain. Note that only the MDF 4 write functionality is required. There is no meaning to do embedded MDF reading. Reading require an operating system. The Rust language is between C and C++ in functionality. It can be used both for reading and writing of MDF files. The reading is useful in converter applications and I suppose in Tauri GUI applications (The Rust GUI challenge). There will be limitations compared to the C++ interface.
Problematic Requirements.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to use this in Rust so developed bindings with bindgen. Thought it might be of interest here.
https://github.com/tuna-f1sh/mdflib-rs
It still needs work - some of the mdflib functionality could be done natively in Rust rather than with bindings for example. It's an interesting experiment however.
I built a basic mdf-candump but intend to use it for a prof of concept logging system.
Beta Was this translation helpful? Give feedback.
All reactions