When Solaar is loaded, if a large number of events happen,
it will lose the register events, as the queue size is too
small (16). So, check if the queue is full, in order to
avoid losing those important events.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
The "already_known" var actually doesn't track if the device was
already registered or not.
That causes race issues at Solaar, causing it to sometimes not
detect a device.
Change the logic to always call register_new_device if the
corresponding events happen, and updating already_known
to reflect it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
The best is to make the logitech-hidpp driver to switch to
hid++ notification mode when it starts. As we don't want users
to mangle with it, let's remove support from it.
PS.: I opted to keep this as a separate patch. This way, if
anyone needs to add support for it, in order to debug the
driver, it is just a matter of reverting this patch.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
The event at address 0 is only produced while in HID++ mode.
The rachet event (address 0x10) happens on both HID and
HID++ modes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Set wrongly to HI_RES_SCROLLING. Correct it to HIRES_WHEEL as reported
by MX Anywhere2.
relates to #283
Signed-off-by: Josenivaldo Benito Jr <jrbenito@benito.qsl.br>
Information from mouse Anywhere MX 2 as provided by @fropeter
Descriptor for mouse based on dump provided
Signed-off-by: Josenivaldo Benito Jr <jrbenito@benito.qsl.br>
Some pt-br translation where ambiguous or too missing 'not' statement.
Add original translator, Mr. Drovetto, to the documentation.
Signed-off-by: Josenivaldo Benito Jr <jrbenito@benito.qsl.br>
PyGIWarning: AppIndicator3 was imported without specifying a version
first. Use gi.require_version('AppIndicator3', '0.1') before import to
ensure that the right version gets loaded.
Automatically detect FN swap feature and DPI adjustment on some newer
devices. DPI adjustment partially addresses support for the MX Master
(#208), Smart shift is still missing.
HID++ 2.0 responses are 20 bytes, once you strip the 4 byte common
header and 1 byte sensorIdx, you have 15 bytes left. Since DPI values
are 16-bit words, only 14 bytes should be used.
Attempt to fix:
$ bin/solaar config master dpi higher
solaar: error: coercing to Unicode: need string or buffer, int found
The DPI choices are integers, therefore cast it to a str.
Fixes the following warnings:
sys:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
sys:1: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
The main window suddenly opening when a battery is critical is very
disruptive. It can pop up on all sort of undesirable scenarios.
Rather than catch users of guard, merely show a notification that the
battery is critical.
I own the former and wanted to correct this detail which caused the wrong
model to be shown in GUI.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
* from_device_number raises an exception if no device found, rather than
returning None. So, instead of checking the result, catch the exception.
* Use Attributes.get() method instead of checking containment and using the
index operator. This is really the only correct way, see rhbz#1267584.
Effect of the changes:
Previously, if no device was found this method would raise an exception.
Now it returns None instead.
Previously this method read the value of the attribute corresponding to key
twice, once via 'key in attributes' and again when accessing the key.
Now, it just reads it the one time.
Reason for noticing all these problems:
In pyudev-0.18 the Attributes class is fixed, and no longer has the []
operator or __contains__ method or other methods which require a total
mapping. This patch fixes several bugs while simultaneously avoiding these
removed operators.
Signed-off-by: mulhern <amulhern@redhat.com>
It's not known whether the DPI ranges can be queried, so let's set
hard-code some values for now. Step size is 200. Does this need to
be changed?
TODO: need a capture of whether this is really a read function.
Based on SetPoint6.65.62_32.exe and Options_2.10.73.exe (features.xml,
defaults.xml, LogiOptionsMgr.exe).
The names are based on the named next to the feature ID. For duplicates,
_2 is appended to the name.
This commands helps parsing numbers from debug prints:
strings LogiOptionsMgr.exe |
sed -nr 's/.*(Feature[0-9a-fA-F]{4})/\1 /p' | sort |
awk 'tolower(a)!=tolower($1){print"";a=$1}1;' | less -S
charging. Since the battery state is unknown when beeing recharged it
will now return "N/A".
Before it would crash becasue level was None and could not be inserted
using %d.
The assumption that the Features IDs are in increasing order does not
hold. This causes the feature check for REPROG CONTROLS (1B00) to fail,
therefore remove the micro-optimisation.
While at it, rename variables and document the functions better.
This options allows the devices list to be restricted which got removed
in:
commit 3b75b69970
Author: Daniel Pavel <daniel.pavel@gmail.com>
Date: Fri Aug 9 12:25:47 2013 +0200
merged solaar-cli functionality into main solaar binary
solaar-cli is still busted, but since it is deprecated, it's probably
fine.
Fix from e3a887f36c, this got removed
in:
commit 3b75b69970
Author: Daniel Pavel <daniel.pavel@gmail.com>
Date: Fri Aug 9 12:25:47 2013 +0200
merged solaar-cli functionality into main solaar binary