How to deliver a software based on F´ to a customer to integrate it into his own software #1042
-
Hi there 👋 I have a question about delivering F´ based software to a customer for integration into their main software. Let me go into a little more detail about this configuration. Let's say a prime contractor designing a spacecraft wants a centralized architecture for cost reasons. This prime contractor then asks its instruments subcontractors to provide control software that it can integrate with its onboard software. In this configuration, the spacecraft software does not communicate with the instrument software via hardware communication buses such as MIL-STD-1553, Spacewire, CAN, Time-Triggered-Ethernet, but by software means such as function calls. I then ask myself different questions: 1- How to manage these different architecture configurations? That is to say, how to manage the project in both centralized and distributed architecture. I would say that the project should be managed by default in a centralized architecture where it is clear in the source code which parts the client should also handle. 2- What do we deliver to the client in terms of software, integration/usage procedure, communication interface? Keeping in mind that it should be very easy to use/integrate for the client. In terms of software, I would say that we should deliver all components as static libraries with their header file. The disadvantage is that there would be a lot of files. As an installation procedure we would ask the client to make some function calls contained in the For the usage procedure, the communication interface with the different APIs available to the client, it seems more complicated to me. Let's imagine that we have two components, component A which is a service provider and component B which is a service consumer. But in the case where component A, the service provider, is on the client side and component B, the service consumer, is on our side, I don't see how the client could pass the information to component B, except by redeveloping the whole logic of the autocoder. 3- What are the limitations imposed on the client? At first sight, we require the customer to use a C++ compiler. If he develops in C, he would probably be tempted to ask us to make a C/C++ wrapper so that he can keep a C compiler to integrate the software developed with F´. What do you think about this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
for the 3rd question: #842 |
Beta Was this translation helpful? Give feedback.
-
It's hard to give a standard answer to these, since it's dependent on how the integrator wants it. They could request just libraries, or they may wish to recompile everything. Either way, they would need a C++ compiler to process any C -> C++ glue code. To get from C to C++, a common pattern I've used is something like this: header file for C code:
void some_bridge_function(int somearg); some C++ glue code file:
// this forces C function symbols
extern "C" {
void some_bridge_function(int somearg);
};
#include "somefile.h"
myClass class1;
void some_bridge_function(int somearg) {
class1.doit(somearg);
} From C:
#include "somefile.h"
void doSomeCThing(int arg) {
some_bridge_function(arg);
} |
Beta Was this translation helpful? Give feedback.
-
You can write a public method for the component that internally calls an output port to bridge the communication. There is no rule that you can't write your own public methods since it is your implementation. We commonly have public methods to pass in configuration data during initialization. It is less common to do it later in execution, but there is no reason you can't. The reverse is also true - if you want to send data back in to the C domain via an API or something similar, then you are in the C++ invoking C pattern again. |
Beta Was this translation helpful? Give feedback.
-
My suggestion was more along the lines of your component B being an F Prime component that interfaced with the C module (not calling the integrator code a component to not confuse the terms). The glue code would call a public function in the B component which would internally call an output port connected to component A. That way component A can be kept isolated from component B and the C module for testing. The library can have the F Prime deployment with interconnections between any components you use. |
Beta Was this translation helpful? Give feedback.
It's hard to give a standard answer to these, since it's dependent on how the integrator wants it. They could request just libraries, or they may wish to recompile everything. Either way, they would need a C++ compiler to process any C -> C++ glue code. To get from C to C++, a common pattern I've used is something like this:
header file for C code:
somefile.h
:some C++ glue code file:
somegluecode.cpp
From C:
someCfile.c