Fixed retrieving medium name (had to take remainingDataElements not dataElements)

This commit is contained in:
dankito 2020-11-20 00:50:27 +01:00
parent 8bf7b24548
commit e5c1fa2b50
1 changed files with 2 additions and 1 deletions

View File

@ -546,12 +546,13 @@ open class ResponseParser(
}
val status = parseCodeEnum(dataElements[1], TanMediumStatus.values())
val mediumName = if (hitabVersion < 2) null else parseStringToNullIfEmpty(dataElements[10])
// TODO: may also parse 'Letzte Benutzung' (second last element) and 'Freigeschaltet am' (last element)
val remainingDataElements = dataElements.subList(2, dataElements.size)
val mediumName = if (hitabVersion < 2) null else parseStringToNullIfEmpty(remainingDataElements[10])
return when (mediumClass) {
TanMediumKlasse.TanGenerator -> parseTanGeneratorTanMedium(mediumClass, status, mediumName, hitabVersion, remainingDataElements)
TanMediumKlasse.MobiltelefonMitMobileTan -> parseMobilePhoneTanMedium(mediumClass, status, mediumName, hitabVersion, remainingDataElements)