Experience: A little random arduino/hello-world stuff, but this is my first real program and has evolved as ive learned more (started not knowing C at all) and worked more. Im more of a hardware person so programming is a complimdntary skill im going for.

Project description: Software for all protocols, devices, etc. in the vending machine indistry, all configurable and modular. Aimed to run on a custom LFS OS (which i intend to make when the time comes), but id also like it to be able to run alone without an OS to manage it.


That said, I have what appears to be an object oriented design (just happened to be that way), kinda. Each device (such as a bill acceptor) has its own program/process (the objects), and multiple source files for each unique part of the code. A source file for physical inputs (abstracts the signals/conditions into logical events), the brain/logic of the device (the main/core part that decides what to do in any situation and processes incoming/outgoing/internal data), and the output file which of course is like the input file, but outputs like motors/lights/actuators all with their controls/drivers abstracted. Also, each i/o file, has uniform code to interact physically with a sort of universal/configurable hardware adapter im making, and so with the physical drivers handled by my device, all the core/brain source code has to do is send configuration data to my adapter (tells it what transport protocol is used, and what voltage and pin configuration, etc.) then from there, send and recieve data abstracted from hardware.


Assuming someone can imagine that by reading, one question I have after reading about C vs C++, is, isnt this object oriented? How would this be better in C++? Just wondering, i never really fond facts in the c/c++ debate, just opinions and claims that facts exist (no references).

Other question, any suggestions on how to better set things up? Say I got a bill validator, and a Vending Machine Controller (the machine itself) and wanna test them virtually against eachother, this simply means linking the i/o to a test program (instead of the io files) that lets me virtually send and recieve the physical i/o like send a quarter accepted command, or a quarter rejected command, or a coin jam command, or an audit reaueat for the vending machine, etc, and see all the physical behaviors/outputs it'd send to the output files. The thing is, i got this set up with two named pipes as the control/coordinater of all these programs, in a multidrop/slave-master configuration. I don't really know how to link the stdin/stdout of a virtual coin changer to the virtual vending machine,i can get the pid of each through my test program, but dont know how to link two unrelated and already running processes like that. Am I forced to start the programs as child processes of the test program? More importantly, how should i be doing this if I intend to run it on linux? from what i understand, linux has both programs, and modules, i always figured these would be modules running in the background. Idk how go make a module yet and was hoping to save all linux learning for when im done, then i can port it over to linux as i read the LFS documentation. All linux programs ive seen so far use stdin/stdout as ways to input/output the data its primary function processes/does-work-on.

idk, kinda a lot juggling in my head might be missing obvious stuff, but, kinda asking for advice on how to better set it up, dont wanna do a ton of work and find out i gotta rewrite a lot of it later. Opinions on how to set it up better? first time using multiple source files and i got multiple programs too that all intermingle lol.