Page 1 of 1

Communication between C and C# programm

Posted: Sun May 07, 2017 9:43 pm
by sandeerius95
Hello everyone,

I have a question now i am working on a little security system that i made in miniature house with some sensors like a PIR, smokedetectors, magnetic contacts and some outputs like a sirene , LEDstrip,... the driving of this inputs/outputs i will do that with a C programm.

On the other side of the project there is an user interface where te user can arm and dissarm the security systems, add/remove sensors, see the logging, ... i will made this in C#.

Some things like arm and dissarm the system need some communication between the C and the C# programm.
But now i wondered what the best way is to do that on the RPI. I know that i can read a TCP/IP server-client but i wondered of there are some other tools that are easyer or some other communcation methonds.

Re: Communication between C and C# programm

Posted: Mon May 08, 2017 8:55 am
by topguy
There is a lot of libraries created for just this purpose.

Will the two programs run on the same computer ?
If yes: google "Linux IPC" ( named pipes is a favorite of mine )

If no:
Maybe look at "ZeroMQ" or "Thrift", or more in the IOT family "MQTT".
Lot of MQTT help to find on this forum at least.