summaryrefslogtreecommitdiff
path: root/src/linux/hidpp-device.h
AgeCommit message (Collapse)AuthorFilesLines
2013-09-03hidpp: fix K750 battery and luminosity propertiesPeter Wu1-0/+1
Since commit b1f12feb1fd4535255f04c91bef90ae11ce57311 ("Factor out the Logitech Unifying support to support other devices"), the battery status would always be reported as 1% for the K750 keyboard. Besides that, the luminosity level was removed. This patch fixes the battery level and re-adds the luminosity level. To avoid negativity issues when reading light level into a double type, make the HidppMessage params unsigned. Signed-off-by: Peter Wu <lekensteyn@gmail.com>
2013-09-03hidpp: retrieve serial number for devices (v2)Peter Wu1-1/+3
Before this, history files were saved as history-rate-M525.dat. Since multiple devices of the same model might be connected, this name is not unique enough. The serial number gives a more reliable path for the history files and allows clients to distinguish their devices (an object path like /org/freedesktop/UPower/devices/mouse_0003o046DoC52Bx0018 does not stay the same). Note: if a serial number cannot be read, instead of reverting this patch, consider splitting the serial refresh from the version, kind and model refresh. - v2: Fix invalid return value when an invalid parameter is passed to hidpp_device_get_serial. Signed-off-by: Peter Wu <lekensteyn@gmail.com>
2013-09-03hidpp: fix properties for unreachable devices (v2)Peter Wu1-0/+1
This includes "is-present" and "state" (which will be marked "unknown"). "percentage" is not touched since it is still an indication of the battery level, changing it to zero is not helpful. Previously, properties were never updated because the refresh would fail when the battery refresh request failed. - v2: fix invalid return value when an invalid parameter is passed to hidpp_device_is_reachable. Signed-off-by: Peter Wu <lekensteyn@gmail.com>
2013-03-28hid++v1 detection for unreachable devices and features upgradeArkadiusz Miśkiewicz1-1/+2
We are back to using HIDPP_FEATURE_ROOT_FN_PING for detecting protocol since it's the official way described in [1]. Unfortunately unreachable devices ("disconnected" in logitech terminology) don't respond to this v1 ping query as described in docs. Seems that docs cover only reachable state reply for version checking. Thus we have to consider HIDPP_ERROR_CODE_UNSUPPORTED to also be v1 (since we actually got some v1 valid answer - error reply). Introduce HIDPP_REFRESH_FLAGS_FEATURES for checking features provided by v2 device. This recheck is triggered when we upgrade from any protocol to v2 in HIDPP_REFRESH_FLAGS_VERSION. This allows us to properly upgrade from v0/v1 to v2 and also we don't send v2 queries when we know that the device is v1. [1] logitech_hidpp10_specification_for_Unifying_Receivers.doc Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Signed-off-by: Richard Hughes <richard@hughsie.com>
2013-01-10Factor out the Logitech Unifying support to support other devicesRichard Hughes1-0/+94