Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion source/brailleDisplayDrivers/brailliantB.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,27 @@ def __init__(self, port="auto"):

def _initAttempt(self):
if self.isHid:
# Ensure to set self.numCells only at the end of this method to prevent display writes before the capabilities/numCells request
numCells = 0
# First try to get cell count from _writeSize
try:
# _writeSize includes 4 bytes of overhead, so subtract 4
numCells = self._dev._writeSize - 4
except AttributeError:
log.debugWarning("Could not get _writeSize from HID device")

# Adjust numCells based on reported number of cells
try:
data: bytes = self._dev.getFeature(HR_CAPS)
reportedNumCells = data[24]
if reportedNumCells > 0:
# Update numCells based on reported cell count from the device
numCells = reportedNumCells
else:
log.debugWarning("Could not get number of cells from HID device using HR_CAPS")
except WindowsError:
return # Fail!
self.numCells = data[24]
self.numCells = numCells
else:
# This will cause the display to return the number of cells.
# The _serOnReceive callback will see this and set self.numCells.
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Bug Fixes

* Humanware Brailliant BI 40X devices running firmware version 2.4 now work as expected. (#17518, @bramd)

## 2024.4.1

This is a patch release to fix a bug when saving speech symbol dictionaries.
Expand Down
Loading