Important: Please read the Qt Code of Conduct -

Attaching drivers for sensors to Qt

  • Hi! I'm working on a device using the Qt for Embedded Linux framework. I'm facing the problem of implementing drivers to read and implement events from various sensors, like the g-sensor and similar. What way would you suggest to do this?

    I was thinking to use dbus to propagate the events, using signals. Is this the best way to go?

  • you could use also "Qt's signal-slot mechanism":

  • I know the signal and slot mechanism, but either I don't know everything related to that or I was not clear.

    What I need to do is writing drivers to provide the QWS with events generated from the hardware. The events should be then propagated to all the processes that require to be informed. As far as I know signal and slots are used for communication among objects. The concept can be used as a IPC by using dbus. So, are you confirming that dbus is a good way to go? Isn't there any other way to send events using Qt event propagation? Is this the way used by Qt mobility sensor module?

    Thanks for your answer!

  • Sorry, that is going beyond my experience. I am certainly no help in that respect.

  • Internally QWS uses a UNIX domain socket to send events to the clients, but unfortunately it doesn't look like there is any way to create custom events using the public interface:

    You could create your own server though that each client would connect to (in addition to the QWS server). QLocalServer could talk directly to the sensor and forward the events to clients who connect with QLocalSocket. DBus is also an option of course.

Log in to reply