I am designing a driver (to run on my HCS08) for communicating with a controller program (running on the PC) via a serial link. The purpose of this is to invoke test functions on the target from the host.
I've come up with a layout for the driver however for the test functions I want to allow any number and any type of arguments and return type. To that end I've created a wrapper structure to store a pointer ( void (*)(void) ) to my test function as well as an enumeration to store what the real underlying function that pointer points to. I then store an array of pointers to possible handler functions for each type combination of arguments and use the enumeration as an offset into the array.
Now this makes the code a little bloated, and since I'm very new to embedded development I'm sure there is something I am missing (an easier way to implement this) or haven't thought of. My questions is, has anyone had any experience with this kind of development (host/target automated embedded testing, or specific to the example I gave: implementing an RMI style system but with embedded systems) ? I'm open to all suggestions,input or comments.