Our desktop application consists of the back of Mono / .NET 3.5, which communicates via USB with various devices and the Silverlight interface, which communicates with the back through sockets. The firmware for the devices was developed internally by C. To speed up the development process and reduce the number of errors, we would like to share the code between our firmware and the desktop application. What tools and methods could you offer us to do this? Better yet, what have you successfully used in your software to solve a similar problem?
The two main things we would like to separate are the message structures that define our communication protocol and the data that are currently defined using the constants of the C / array structure. For protocol messages, we are currently manually rewriting our classes that implement messages according to C definitions, using the C code as a guide. For the data that we share, we created a C ++ managed application that references compiled C code, then extracts the contents of the arrays into an XML file.
Our methods work, but they are less than optimal. Firstly, we had a lot of errors related to our interpretation of C structures as C #, due to changes in C code in parallel and programmer errors; we would like to avoid this class of errors in future development. For data exchange, I donβt have a big problem with our current solution, but the developer of the extraction program says that this is a painful process that allows you to work correctly.
We are a bit limited by what we can change on the firmware for devices. Firstly, we have a large number of processor architectures and embedded platforms, so C code should remain portable. On the other hand, the firmware launches real-time software and is limited by the available MIPS and storage space, so we cannot add anything with unpredictable or slow runtimes.
source share