-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use USB scan #4
Comments
Hey, @JakeWoki did you find a way to use USB for scanning? |
val usbManager = getApplication<Application>().getSystemService(Context.USB_SERVICE) as UsbManager?
if (usbManager == null) {
_readIdCardEvent.value = Event(Results.Error(TypeCastException(getString(R.string.id_card_err))))
} else {
val deviceList: HashMap<String, UsbDevice> = usbManager.deviceList
for ((_, value) in deviceList) {
if (value.vendorId == 1024 && value.productId == 50005) {
val var10 = value.getInterface(0)
_endpointWrite = var10.getEndpoint(0)
_endpointRead = var10.getEndpoint(1)
Intrinsics.checkExpressionValueIsNotNull(_endpointRead, "endpointRead")
_connection = usbManager.openDevice(value)
_connection?.claimInterface(var10, true)
return
}
}
_readIdCardEvent.value = Event(Results.Error(TypeCastException(getString(R.string.id_card_err))))
} You can try this. It's been too long, and I forgot |
@JakeWoki |
Porting Linux to Android, and it's very difficult.Or use WIFI or use SDK. WIFI use reference
request boby |
@JakeWoki |
Some machine manufacturers provide SDK services.eg epson |
No description provided.
The text was updated successfully, but these errors were encountered: