mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
USB WIP
This commit is contained in:
parent
303fb86aa6
commit
420b718b11
4 changed files with 125 additions and 45 deletions
|
|
@ -13,6 +13,8 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.pm.PackageManager
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.hardware.usb.UsbManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
|
@ -427,6 +429,11 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
|
||||
// We now wait for the device to connect, once connected, we ask the user if they want to switch to the new channel
|
||||
}
|
||||
|
||||
if (appLinkAction == UsbManager.ACTION_USB_ACCESSORY_ATTACHED) {
|
||||
val device: UsbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE)!!
|
||||
errormsg("Handle USB device attached! $device")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue