apidocs / com.nimmsta.core.android.device / NIMMSTAHidDeviceImpl

NIMMSTAHidDeviceImpl

class NIMMSTAHidDeviceImpl : NIMMSTADeviceImpl

This is a special version of NIMMSTADeviceImpl specialized for Android HID Compatbility. You can send HID chars with the sendHID API. You have to check if HID is enabled by checking allowHid first.

Constructors

<init>

This is a special version of NIMMSTADeviceImpl specialized for Android HID Compatbility. You can send HID chars with the sendHID API. You have to check if HID is enabled by checking allowHid first.

NIMMSTAHidDeviceImpl(deviceScanner: NIMMSTADeviceScanner, scanRecord: SearchScanResult, delegate: NIMMSTAEventHandler? = null, connectionManager: INIMMSTAConnectionManager)

Properties

allowHid

indicates if connected device allows HID sending.

val allowHid: Boolean

barcodeRules

Override setter of barcode rules as it influences HID requirement.

var barcodeRules: BarcodeRules?

bondingTask

this will be true during bonding.

var bondingTask: Task<Unit>?

prefersHIDMode

Defines whether to force HID mode. Please be aware to set this before connecting, e.g. during didStartConnecting.

var prefersHIDMode: Boolean

Functions

compatibilityIssues

Returns issue if it should have HID mode but it does not support it right now.

fun compatibilityIssues(): Task<Set<CompatibilityIssue>>

initConnectionFromBleServiceAsync

Adapts connection process to allow HID.

fun initConnectionFromBleServiceAsync(uartService: UARTServiceInterface, cancellationToken: CancellationToken): Task<Unit>

initDevice

suspend fun initDevice(uartService: UARTServiceInterface, cancellationToken: CancellationToken): Unit

rulesNeedHID

Returns if HID mode must be supported due to HID characters in the rule.

fun rulesNeedHID(): Boolean

sendHID

Sends a HID char to the HS 50 to be inserted as keycode into the system. Currently we only support enter, escape, backspace and tab. Use the respective Unicode representation for it. Currently supported are: '\u000D' or '\ue013' -> Enter '\u0009' or '\ue015' -> Horizontal Tab '\u0008' -> Backspace '\u001B' -> Escape

fun sendHID(char: Char, cancellationToken: CancellationToken? = null): Task<Unit>

setLayout

Wait for set layout when bonding.

fun setLayout(layout: NimmstaLayout, infoMap: Map<String, String>, clearOldInfo: Boolean): Task<NimmstaLayout>

setLayoutFor

Wait for set layout when bonding.

fun setLayoutFor(timeout: TimeSpan, layout: NimmstaLayout, infoMap: Map<String, String>, continuation: ((Boolean) -> Unit)?): Task<NimmstaLayout>

shouldConnectHID

Returns true if this should connect as HID device either due to ConnctionManager or due to rule.

fun shouldConnectHID(): Boolean

Companion Object Properties

HID_CHAR_TRANSLATION

val HID_CHAR_TRANSLATION: <ERROR CLASS>

HID_TIMEOUT

val HID_TIMEOUT: TimeSpan

TAG

val TAG: String