update DeviceInfo

This commit is contained in:
Adam Velebil 2024-03-26 15:27:10 +01:00 committed by Elias Bonnici
parent 9a3659a423
commit ccf0c16584
No known key found for this signature in database
GPG Key ID: 5EAC28EA3F980CCF
3 changed files with 6 additions and 1 deletions

View File

@ -49,8 +49,10 @@ data class Info(
val isNfc: Boolean,
@SerialName("usb_pid")
val usbPid: Int?,
@SerialName("pin_complexity")
val pinComplexity: Boolean,
@SerialName("supported_capabilities")
val supportedCapabilities: Capabilities
val supportedCapabilities: Capabilities,
) {
constructor(name: String, isNfc: Boolean, usbPid: Int?, deviceInfo: DeviceInfo) : this(
config = Config(deviceInfo.config),
@ -63,6 +65,7 @@ data class Info(
name = name,
isNfc = isNfc,
usbPid = usbPid,
pinComplexity = deviceInfo.pinComplexity,
supportedCapabilities = Capabilities(
nfc = deviceInfo.capabilitiesFor(Transport.NFC),
usb = deviceInfo.capabilitiesFor(Transport.USB),

View File

@ -18,5 +18,6 @@ val UnknownDevice = Info(
name = "Unrecognized device",
isNfc = false,
usbPid = null,
pinComplexity = false,
supportedCapabilities = Capabilities()
)

View File

@ -74,6 +74,7 @@ class SkyHelper(private val compatUtil: CompatUtil) {
name = (device.usbDevice.productName ?: "Yubico Security Key"),
isNfc = false,
usbPid = pid.value,
pinComplexity = false,
supportedCapabilities = Capabilities(usb = 0)
)
}