Device Management
6 min
this section covers how to discover, select and inspect the miura device the sdk transacts with two related topics have their own sub pages device setup & readiness docid\ uymefwqpssfdqgfpvlaxg bringing a reader into a toro compatible state with the single ensuredeviceready() entry point tms updates docid\ mgajmjirkck4yk0mzhann how security parameters and configuration are kept current via the terminal management system (tms) listing available miura devices bluetooth this will return a list of bluetoothdevice instances, excluding the selectedbluetoothdevice miura devices which have not been paired in the android bluetooth settings will not be returned usb this will return a list of usbdevice instances that are currently attached to the system, excluding the selectedusbdevice selecting a device bluetooth to select the device you want to use, set the selectedbluetoothdevice property on the toroclient instance to unset the selected device, set the selectedbluetoothdevice property to null usb to select the device you want to use, set the selectedusbdevice property on the toroclient instance to unset the selected device, set the selectedusbdevice property to null getting device information you can get information about the selected device using the getdeviceinfo method on the toroclient instance this returns a miuradeviceinfo object containing information about the selected device, such as its serial number, system time, hardware identifier, os and mpi versions, battery status, configuration file versions and p2pe/security status readiness at a glance baselinestatus miuradeviceinfo exposes a baselinestatus ( baselinestatus ) giving a per condition breakdown of whether the device meets the sdk's baseline requirements to transact baselinestatus meetsbaseline is a convenience flag that is true only when all four conditions are met device session state you can check whether the device is currently in use by the toro sdk using the issessionopen property on the toroclient instance this will return true if the device is currently in use, and false otherwise usb device listener you can also register a usbdevicelistener to receive usbdeviceevent updates if you are using connectionmode usb val listener = usbdevicelistener { event > when (event) { is usbdeviceevent deviceattached > todo() is usbdeviceevent devicedetached > todo() is usbdeviceevent permissiondenied > todo() is usbdeviceevent permissiongranted > todo() is usbdeviceevent permissionpending > todo() } } // register the listener with the toroclient instance toro setusbdevicelistener(listener)usbdevicelistener listener = new usbdevicelistener() { @override public void onusbdeviceevent(@nonnull usbdeviceevent event) { if (event instanceof usbdeviceevent deviceattached) { // handle device attached } else if (event instanceof usbdeviceevent devicedetached) { // handle device detached } else if (event instanceof usbdeviceevent permissiondenied) { // handle permission denied } else if (event instanceof usbdeviceevent permissiongranted) { // handle permission granted } else if (event instanceof usbdeviceevent permissionpending) { // handle permission pending } } }; // register the listener with the toroclient instance toro setusbdevicelistener(listener);
