Device Management
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 & ReadinessDevice Setup & Readiness: bringing a reader into a Toro-compatible state with the single ensureDeviceReady() entry point.
- TMS UpdatesTMS Updates: how security parameters and configuration are kept current via the Terminal Management System (TMS).
Listing available Miura devices
let devices = toro.bluetoothMiuraDevicesThis will return a list of EAAccessory instances that are available to use with the ToroSDK. For a device to be listed, it will need to be showing as connected in the iOS Bluetooth settings.
Selecting a device
To select the device you want to use for transactions and device management operations, set the selectedDevice property on your ToroClient instance.
toro.selectedDevice = device // where device is an EAAccessory instanceTo unset the selected device, set the selectedDevice to nil.
toro.selectedDevice = nilGetting device information
You can get information about the selected device using the getDeviceInfo method on the ToroClient instance:
toro.getDeviceInfo { result in
switch result {
case .success(let deviceInfo):
self.deviceInfo = deviceInfo
case .failure(let error):
self.errorMessage = error.localizedDescription
}
}This will return a MiuraDeviceInfo object containing information about the selected device, such as its serial number, system time, battery status, etc.
Device session state
You can check if the device is currently in use by the Toro SDK using the isSessionOpen property on the ToroClient instance:
toro.isSessionOpenThis will return true if the device is currently in use, and false otherwise.