BrailleDisplayCallback
interface BrailleDisplayCallback
android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback |
Interface provided to BrailleDisplayController
connection methods to receive callbacks from the system.
Summary
Constants | |
---|---|
static Int |
A unique Braille display matching the requested properties could not be identified. |
static Int |
The system cannot access connected HID devices. |
Public methods | |
---|---|
abstract Unit |
onConnected(hidDescriptor: ByteArray) Callback to observe a successful Braille display connection. |
abstract Unit |
onConnectionFailed(errorFlags: Int) Callback to observe a failed Braille display connection. |
abstract Unit |
Callback to observe when the currently connected Braille display is disconnected by the system. |
abstract Unit |
Callback to observe input bytes from the currently connected Braille display. |
Constants
FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND
static val FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND: Int
A unique Braille display matching the requested properties could not be identified.
Value: 2
FLAG_ERROR_CANNOT_ACCESS
static val FLAG_ERROR_CANNOT_ACCESS: Int
The system cannot access connected HID devices.
Value: 1
Public methods
onConnected
abstract fun onConnected(hidDescriptor: ByteArray): Unit
Callback to observe a successful Braille display connection.
The provided HID report descriptor should be used to understand the input bytes received from the Braille display via onInput
and to prepare the output sent to the Braille display via write
.
Parameters | |
---|---|
hidDescriptor |
ByteArray: The HID report descriptor for this Braille display. This value cannot be null . |
onConnectionFailed
abstract fun onConnectionFailed(errorFlags: Int): Unit
Callback to observe a failed Braille display connection.
Parameters | |
---|---|
errorFlags |
Int: A bitmask of error codes for the connection failure. Value is either 0 or a combination of android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback#FLAG_ERROR_CANNOT_ACCESS , and android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback#FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND |
onDisconnected
abstract fun onDisconnected(): Unit
Callback to observe when the currently connected Braille display is disconnected by the system.
onInput
abstract fun onInput(input: ByteArray): Unit
Callback to observe input bytes from the currently connected Braille display.
Parameters | |
---|---|
input |
ByteArray: The input bytes from the Braille display, formatted according to the HID report descriptor and the HIDRAW kernel driver. This value cannot be null . |