Parent: 51cae76d75a03bf6a812328d5d760065661c07f0
Author: Petri Gynther <pgynther@google.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2015-09-07 16:04:41
Tree: f21604e7839123c29faca495099d41bba44192d7
hog: handle HoG init failures correctly When attio_connected_cb() is called for a HoG device, BlueZ should be in one of the two states: 1) hogdev->uhid_created == FALSE && hogdev->reports == NULL * initial connection to HoG device, or first reconnect after BlueZ has been restarted * BlueZ needs to discover all HoG device characteristics (including report map) and create uHID device for HID input 2) hogdev->uhid_created == TRUE && hogdev->reports != NULL * second or subsequent reconnect * all HoG device characteristics (including report map) have been successfully discovered previously, and uHID device has been created However, it is possible that the connection between BlueZ and HoG device is abruptly terminated amid HoG device characteristics discovery. Or, HoG report map discovery might intermittently fail. This can leave BlueZ in inconsistent state such that it knows about some of the characteristics, but the report map was never received and uHID device not created, i.e.: hogdev->uhid_created == FALSE && hogdev->reports != NULL attio_connected_cb() needs to detect this condition, clean up hogdev->reports, and re-discover HoG device characteristics.
Diffstat
| M | profiles/input/hog.c | | | 30 | ++++++++++++++++++- - - - - - - - - - - - |
1 files changed, 18 insertions(+), 12 deletions(-)