Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the obfuscated PWA #1

Merged
merged 172 commits into from Sep 14, 2022
Merged

Add the obfuscated PWA #1

merged 172 commits into from Sep 14, 2022

Conversation

d4s
Copy link
Collaborator

@d4s d4s commented Sep 14, 2022

Sources from this MR are modified due legal obligations:

  • removed all files related to Vendors
  • removed all mentioning of particular Vendors, Models, IDs

Gustavo Noronha Silva and others added 30 commits September 14, 2022 20:52
This adds a basic plugin infrastructure to add support for various mice.
The first mouse that is being implemented is the Vendor2 Model21. Right now
we don't have enough information to fully support it, but basic colors
can be configured.
HID code by Denis Pynkin <denis.pynkin@collabora.com>

This change adds the basic infrastructure to get notified of incoming
reports sent by the device. HID is highly asynchronous, so the reply for
output reports actually comes as an input report.
HID code by Denis Pynkin <denis.pynkin@collabora.com>

Initial backend for that mouse with support only for getting the
firmware version at this point.
Adopt the JavaScript camelCase format for variables, functions and
methods. Use ALL_CAPS for constants.

This change also reformats the code with prettier, with a custom 4-space
tab width, and adds configuration for vscode to automatically format the
code on save.
HID code by Denis Pynkin <denis.pynkin@collabora.com>

For now only static colors are supported, with the same color being
applied to all zones.
This also adds a notification for when the device is connected.
This adds LED capabilities, so that backends can tell the UI what
exactly can be configured and how. For now it supports specifying what
ranges of colors are supported by all leds, which lets the UI show
either the simple R/G/B buttons or a color picker.
Using Model11 3's ability to change 3 zones for now, we enable either
changing the color for all LEDs in one go or for each of the 3 separate
zones.
HID code by Denis Pynkin <denis.pynkin@collabora.com>

At the abstraction layer we provide both a way of asking for the config
for a specific zone and to reques the whole configuration, as some mice
are likely to have a single command that returns everything, so we give
them the ability to optimize.
HID code by Denis Pynkin <denis.pynkin@collabora.com>

Populate the HTML from the capabilities reported by the mouse, allow
selection of DPI setting for each DPI level available on the mouse. This
also shows the currently selected values.
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
UNDEFINED state is for unexpected or not set values

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Must to use asynchronous operations for device querying.
Otherwise the device may have no enough time to create a response
for some of requests sent in a raw.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Moved the (possible) common code for Model11 family to inherited class.
Minor fixes in queries.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Added initial version of module for Model11 3 Wireless.
This version is working thru direct USB and via dongle.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
MatheusCod and others added 27 commits September 14, 2022 20:53
Creates a promise race between a given promise and a waitTimeout().
Add its tests.
Creates promise which will run again a given number of times if an
Error is thrown.
Add its tests.
Creates createMaybeAbortablePromise which will also listen to a given
event.
Add its tests.

OBS: EventEmitter is relaxed and allows for multiple arguments, such as
`emitter.emit(1, 'abc')` will call your event handler with all of
those arguments.

In such case we should cooperate with that, otherwise we just get the
first argument and discard the rest
Returns a promise which will contains a
createEventWaitPromise and another given promise. The latter will
be used to run the devices commands.
Add its tests.
Creates a command buffer which will queue sequential
commands given to the device.
Add its tests.
In manager.service, creates a addCommandBuffer helper which will
use the commandBuffer from lib/ts/devices/utils to queue the UI
commands to the device.
In the BE, add proper Promise.resolve in requestFirmwareVersion and
requestBatteryLife for Vendor2Model21 and Vendor1 Model11 when in
wired mode.

Also in the BE, remove requestCurrentConfig method for all devices
and manager call.
Its possible results were not only not being listened by anyone,
but also because we are queueing the device calls in the
manager.service, calling requestCurrentConfig would request info
from the device without respecting the queue order.
Remove `TODO`s.
Change eslint-disable from file disable to next line disable.
When selecting a key to change the input binding, its current
binding value in the UI should be updated.
Remove `TODO`s.
Refactor `setDpiInput`, change its regex to reject values which
aren't number chars.
Remove `TODO`s.

refactor: use Angular property binding
style: increase width to better fit five digit values
Base URL is https://google.pages.collabora.com/delish/[branch name]

Signed-off-by: Vladimir Shakhov <mend0za@collabora.com>
* different store policy for 'main' and 'wip/*'
* parametrized Gitlab Pages deploy rules

Signed-off-by: Vladimir Shakhov <mend0za@collabora.com>
Signed-off-by: Vladimir Shakhov <mend0za@collabora.com>
Signed-off-by: Vladimir Shakhov <mend0za@collabora.com>
Allow to set CPI and LEDs.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Using mouse-specific naming. Rationale:
https://dotesports.com/hardware/news/what-is-the-difference-between-cpi-and-dpi

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
@google-cla
Copy link

google-cla bot commented Sep 14, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@zbarakzoy zbarakzoy merged commit 71a8ef1 into main Sep 14, 2022
@d4s d4s deleted the wip/d4s/clean branch September 29, 2022 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants