Lisp HUG Maillist Archive

Interfacing LispWorks with devices

Hi !

I would like to interface interfacing physical devices with LispWorks in a cross platform way.
This could be joysticks, sensors, or multi-touch tablets ...  more or less simple devices.

I already have written user-space drivers for these devices in C or C++, so I could spawn child processes which would pipe the devices' data as lisp tuples on their standard-output.

On LispWorks side, I would "(read)" the data, but since it is a blocking call, I am not sure exactly how I can read from several of those processes simultaneously (1).  It looks like I will need to use multi-processing to have a thread for each child process.

I also need to communicate with the devices, like turning on a LED.  I thought I could use the same idea the other way, ie sending tuples to the standard-input.  That would require to parse the lisp formatted tuple, which does not look very convenient from C (2).

- First of all, is there something LispWork provides that would be more suited to my problem or better than just using stdio?
- Do you have suggestions for (1) or (2)?


Thank you for reading.


Best Regards,
Cam


Updated at: 2020-12-10 08:37 UTC