Updated on 2026-08-14
This commit is contained in:
parent
4b7cd3e99f
commit
f426fba287
3 changed files with 6 additions and 4 deletions
|
|
@ -18,6 +18,7 @@ enum class Instruction(var code: Int) {
|
|||
|
||||
|
||||
companion object {
|
||||
fun byCode(code: Int): Instruction = values().find { it.code == code } ?: Unknown
|
||||
private val values = values()
|
||||
fun byCode(code: Int): Instruction = values.find { it.code == code } ?: Unknown
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,8 @@ enum class StatusWord (val code: Int, val description: String){
|
|||
NeedPause(0x9789, "SW_NEED_PAUSE");
|
||||
|
||||
companion object {
|
||||
fun byCode(code: Int): StatusWord = values().find { it.code == code } ?: InvalidParams
|
||||
private val values = values()
|
||||
fun byCode(code: Int): StatusWord = values.find { it.code == code } ?: Unknown
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,9 +108,9 @@ enum class TlvTag(val code: Int) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun byCode(code: Int): TlvTag = values().find { it.code == code } ?: Unknown
|
||||
private val values = values()
|
||||
fun byCode(code: Int): TlvTag = values.find { it.code == code } ?: Unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue