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

View File

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

View File

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