|
1 | 1 | import string |
| 2 | +import typing |
2 | 3 | from enum import Enum |
3 | 4 | from typing import Any, Union, List, Optional, Tuple |
4 | 5 |
|
@@ -177,7 +178,7 @@ def from_bytes(self, v: Union[bytes, List[int]]) -> str: |
177 | 178 | else CurrentContext.get('character_set', CharacterSet.DEFAULT) |
178 | 179 | return decode(bytes(v), character_set) |
179 | 180 |
|
180 | | - def to_bytes(self, v: str, length: int = None) -> bytes: |
| 181 | + def to_bytes(self, v: str, length: typing.Optional[int] = None) -> bytes: |
181 | 182 | character_set = self._character_set if self._character_set is not None \ |
182 | 183 | else CurrentContext.get('character_set', CharacterSet.DEFAULT) |
183 | 184 | retval = encode(v, character_set) |
@@ -320,9 +321,14 @@ def __get__(self, instance, objtype=None) -> TLV: |
320 | 321 | 0x15: StringField(name="language_code", character_set=CharacterSet.ASCII_7BIT), |
321 | 322 | 0x23: ContainerType(name='receipt-numbers'), |
322 | 323 | 0x1a: BEIntField(name='max_apdu_length', length=2), |
| 324 | + 0x1b: BEIntField(name='diagnosis_type', length=1), |
323 | 325 | 0x1d: BEIntField(name='file_id', length=1), |
324 | 326 | 0x1e: BEIntField(name='start_position', length=4), |
325 | 327 | 0x40: BytesField(name='emv_config'), |
| 328 | + # variable length -> important IDs can be found in ZvtCardType |
| 329 | + 0x41: BytesField(name='card_type_id'), |
| 330 | + 0x42: StringField(name="application_label", character_set=CharacterSet.ASCII_7BIT), |
| 331 | + 0x43: BytesField(name="application_id"), |
326 | 332 | 0x1f00: BEIntField(name='file_size', length=4), |
327 | 333 | 0x1f10: FlagByteField(name="cardholder_identification", data_type=CardholderIdentification), |
328 | 334 | 0x1f11: FlagByteField(name='online_tag', data_type=OnlineTag), |
|
0 commit comments