Fix Hims usb detection issues and scroll keys input for Polaris displays #7865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None, however reported in this NVDA-devel post.
Summary of the issue:
As described by Alberto Buffolino
Description of how this pull request fixes the issue:
Introduced a timeout when terminating the display, similar to the superBrl driver, just to make sure that the device closes properly. This seemed to improve things, but didn't fix it entirely.
Sending the cell count request is now part of the for i in xrange(3) loop, thereby increasing the likelyhood that the cell request is received and acted upon by a display.
This also contains a workaround which was initially part of my work for this driver in Give NVDA the ability to automatically detect braille displays. #1271. It seems that Hims devices, particularly the Braille Edge, advertise themselves to the system while not yet operable. In that case, NVDA will try to connect but the display will not respond. For this case, I increased the maximum connection timeout for these displays in USB bulk mode to 2*3 = 6 seconds. This seems quite drastic, but:
A. It seems to make sure that auto detection in USB mode always succeeds, even in the case where a device is not operable for a long time
B. Note that in case of Bluetooth devices that are not in range, the minimal timeout is 5 seconds, and that timeout increases with 5 seconds for every other paired but not in range display that a driver supports.
C. The chance that one selects this display in the braille settings while the display is in connected but yet inoperable seems quite low.
D. This amount of 6 seconds is the absolute maximum, i.e. in most cases, a display will respond far earlier than that.
Nevertheless, alternative ideas are welcome of course.
Fix for Polaris input
Hims also reported an issue regarding the scroll keys of their Braille Sense Polaris, which did not work correctly. This has also been fixed as part of this pr.
Testing performed:
From Alberto again:
I've also done some tests as part of #1271 myself, and I wasn't able to trigger the behavior that Alberto reported initially.
Regarding the Polaris input, this has been tested by Hims and works as expected.
Known issues with pull request:
None I'm aware of, but as we are well in time before 2018.1, let's not merge this straight into master.
Change log entry: