We use Rabbit micro on one of our products and we have a new requirement to add a new protocol on this platform.
However , The functionality for this protocol is to be already developed in ANSI C whereas we find that the Rabbit code is to be written in Dynamic C.
Can we use a module that is created in ANSI C into the sources that already exist in Dynamic C language.
Can we develop a library in ANSI C and port it in Dynamic C and is this feasible?
Please let me know if you require any additional info.
The answer to this will depend on which version of DC you are using. The latest DC10 versions make it much easier to use ANSI C code with Dynamic C as they support the include keyword and a project build feature which allows specification of the files to build an application with.
Older versions of DC 10 (pre 10.66 I think) and DC 9 are more difficult to use ANSI C with and require you to create function headers for everything.
Having said all that, even with the latest DC10 there are advantages to doing it the DC way and adding the function headers etc as this allows the compiler drop code and data that is not used in the current build and can reduce code size considerably if you are only using some of the functions in a given file.
I ported the BACnet stack from ANSI C to Dynamic which has a lot of files and the biggest part of the process was creating the headers for every function (it is well written C with LOTS of small functions!). The actual code changes required to get the initial code functioning did not take as long as the grunt work of massaging the files to add headers for everything.