Commit graph

11 commits

Author SHA1 Message Date
Peter Hutterer
39b5ba74a4 Switch the various coordinates to doubles
Original idea of 1/1000 of a pixel was to allow subpixels while sending fixed
width down the wire. Let's not care about that and use doubles instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-13 16:17:51 +10:00
Peter Hutterer
b547fdc529 Improve naming for the DeviceAdded message
DeviceAdded is more self-explanatory than just "Added"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-13 16:17:51 +10:00
Peter Hutterer
55246512f0 Add capabilities to the Added event
This makes it possible for the server to limit capabilities.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-10 19:32:34 +10:00
Peter Hutterer
6f75463261 Rename "accepted" to "added" for consistency with the public API
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-10 08:49:22 +10:00
Peter Hutterer
fe22b9b5a5 proto: specify that the protocol isn't batch-compatible after all
The protocol itself could work like originally described here but there's a
stumbling block: the decision on whether to accept a device is made by the
caller through EIS_EVENT_DEVICE_ADDED and the following eis_device_connect()
call. We cannot process any events from that device until that call is
complete and that effectively disallows batch submission of requests.

To allow batching we'd have to pause the protocol but that means missing out
on other devices (and their events) and disconnect events. The alternative to
that would be for libeis to peek at incoming requests and sort them by device
ID so we only pause one device's stream but now we're also mangling the device
event order and potentially triggering all sorts of side-effects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-10 08:04:05 +10:00
Peter Hutterer
4cfa6e6225 Add configuration messages to the protocol
For the Portal case, we'll have the portal open the sockets for us and then
(depending on policy) restrict what the client can do. Then the socket can be
passed to the client with e.g. keyboards disabled and the client is none the
wiser (other than that the server will reject any keyboard caps).

Since the portal doesn't need a EI context, the configuration is a separate
small library.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-07 16:05:57 +10:00
Peter Hutterer
2f855c568c Drop the "hello" message
The main purpose of that was for (plain-text protocol) debugging. With the
current intentions to "preload" a connection with restrictions, having the
server initiate a connection is not useful.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-07 14:46:20 +10:00
Peter Hutterer
a9f07368a5 Implement pointer button and keyboard key events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 12:00:31 +10:00
Peter Hutterer
81d4556dcc proto: add a fixed-length frame message
protobuf relies on external framing and exact buffer lengths to parse things
correctly. So let's provide that by sending a fixed-length Frame message
before every real message.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 11:59:05 +10:00
Peter Hutterer
cf6dec8e15 proto: add a protocol specification
Just so it's a bit more obvious what sequences we expect

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 07:55:25 +10:00
Peter Hutterer
9f851bcccb Replace the custom message parsing with protobuf
Plain-text was useful for the initial implementation where the counterpart was
netcat but now that both parts are in place, protobuf is a much more
convenient system to handle a frequently-changing protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-31 13:05:11 +10:00