This was intentional here but valgrind doesn't like it, so let's just set it
to something that should look odd.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Building with a releaes build reshuffles things so this ends causing potential
issues. Initialize to NULL to avoid around this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Mostly copied from libinput and simplified so we only test on Fedora for now.
Good enough that it should catch accidental breakages.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The logger utilities are useful for quick prototyping, but we've reached the
point where we need the "proper" implementation of a log handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The logger utilities are useful for quick prototyping, but we've reached the
point where we need the "proper" implementation of a log handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make the default set an enum with an array to access the codes. Additionally
provide a true RBG escape sequence, all modern terminals support that anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Where the server connects a device after the client has already removed it, we
need to ignore that message silently.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This was already spelled out in the documentation but just not yet
implemented. New starting state for any device added by EIS is "suspended",
the server needs to explicitly resume it before events are accepted.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These were added originally to illustrate how the diffent backends could work
but they're not going to be implemented this way anyway. So let's just drop
them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If a client calls ei_device_remove(), it should consider that as the last
interaction with this device (short of unref). There is no need for the server
to confirm this, no further events must reach the client for this device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we get disconnected after calling ei_device_add() but before EIS saw and
processed the event, we need to emulate a removed event ourselves.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This function dispatches until a stable state is reached - that could be no
event waiting or some event waiting to be processed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This de-duplicates a bunch of things that we don't need to duplicate,
specifically the protocol part that splits the data up into parseable chunks.
That we have Frames in between messages is an implementation detail, this way
neither libei nor libeis have to care about it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The goal here is to separate any state checking and other processing from the
actual bits writing onto the wire so we can test those separately.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Same as already done for libei. There's relatively little benefit here since
we won't have a lot of different events and any caller will do the switch
based on the event type anyway. So let's just export a single event type and
have everything contained in that.
Since this required rewriting all getters, let's move the lot to a new file
and streamline things a bit that way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>