reader-integration-kit-linux-armhf 1.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. reader_integration_kit/__init__.py +12 -0
  2. reader_integration_kit/enum/__init__.py +28 -0
  3. reader_integration_kit/enum/beep_duration.py +12 -0
  4. reader_integration_kit/enum/beep_volume.py +15 -0
  5. reader_integration_kit/enum/ble_data_type.py +12 -0
  6. reader_integration_kit/enum/blob_type.py +27 -0
  7. reader_integration_kit/enum/checkpoint_type.py +13 -0
  8. reader_integration_kit/enum/data_conversion_type.py +12 -0
  9. reader_integration_kit/enum/field_definition_type.py +14 -0
  10. reader_integration_kit/enum/led_color.py +15 -0
  11. reader_integration_kit/enum/protocol_type.py +14 -0
  12. reader_integration_kit/enum/proximity_card_type.py +166 -0
  13. reader_integration_kit/enum/reader_module_id.py +13 -0
  14. reader_integration_kit/enum/reader_module_state.py +12 -0
  15. reader_integration_kit/enum/serial_port_baud_rate.py +15 -0
  16. reader_integration_kit/enum/serial_port_data_bits.py +10 -0
  17. reader_integration_kit/enum/serial_port_flow_control.py +11 -0
  18. reader_integration_kit/enum/serial_port_parity.py +10 -0
  19. reader_integration_kit/enum/serial_port_stop_bits.py +9 -0
  20. reader_integration_kit/enum/transparent_mode_state.py +11 -0
  21. reader_integration_kit/enum/transparent_mode_status.py +11 -0
  22. reader_integration_kit/errors/__init__.py +4 -0
  23. reader_integration_kit/errors/reader_exception.py +58 -0
  24. reader_integration_kit/facade/__init__.py +852 -0
  25. reader_integration_kit/lib/libReaderIntegrationKit.so +0 -0
  26. reader_integration_kit/lib/libReaderIntegrationKit.so.1.4.0 +0 -0
  27. reader_integration_kit/structures/__init__.py +36 -0
  28. reader_integration_kit/structures/blob_header.py +54 -0
  29. reader_integration_kit/structures/bluetooth_firmware_version.py +35 -0
  30. reader_integration_kit/structures/card_data.py +77 -0
  31. reader_integration_kit/structures/card_type_info.py +51 -0
  32. reader_integration_kit/structures/device_id.py +12 -0
  33. reader_integration_kit/structures/extended_configuration.py +32 -0
  34. reader_integration_kit/structures/felica_sam_firmware_version.py +38 -0
  35. reader_integration_kit/structures/field_entry.py +120 -0
  36. reader_integration_kit/structures/field_separator_data_header.py +83 -0
  37. reader_integration_kit/structures/hash_data.py +55 -0
  38. reader_integration_kit/structures/hid_se_sam_firmware_version.py +38 -0
  39. reader_integration_kit/structures/led_configuration.py +13 -0
  40. reader_integration_kit/structures/library_info.py +74 -0
  41. reader_integration_kit/structures/luid_response_information.py +44 -0
  42. reader_integration_kit/structures/microcontroller_firmware_version.py +38 -0
  43. reader_integration_kit/structures/nxp_sam_firmware_version.py +38 -0
  44. reader_integration_kit/structures/reader_configuration.py +171 -0
  45. reader_integration_kit/structures/reader_data.py +49 -0
  46. reader_integration_kit/structures/reader_definition.py +14 -0
  47. reader_integration_kit/structures/reader_metadata_struct.py +195 -0
  48. reader_integration_kit/structures/rik_result.py +71 -0
  49. reader_integration_kit/structures/separator_character.py +44 -0
  50. reader_integration_kit/structures/separator_entry.py +73 -0
  51. reader_integration_kit/structures/serial_port_settings.py +45 -0
  52. reader_integration_kit/structures/smart_card_configuration.py +34 -0
  53. reader_integration_kit_linux_armhf-1.4.0.dist-info/METADATA +115 -0
  54. reader_integration_kit_linux_armhf-1.4.0.dist-info/RECORD +57 -0
  55. reader_integration_kit_linux_armhf-1.4.0.dist-info/WHEEL +5 -0
  56. reader_integration_kit_linux_armhf-1.4.0.dist-info/rfIDEAS_EULA.txt +281 -0
  57. reader_integration_kit_linux_armhf-1.4.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,12 @@
1
+ from reader_integration_kit.facade import (
2
+ AbstractReader,
3
+ Reader,
4
+ ReaderHandle
5
+ )
6
+
7
+ __all__ = [
8
+ 'AbstractReader',
9
+ 'Reader',
10
+ 'ReaderHandle'
11
+ ]
12
+
@@ -0,0 +1,28 @@
1
+ from reader_integration_kit.enum.beep_duration import BeepDuration
2
+ from reader_integration_kit.enum.beep_volume import BeepVolume
3
+ from reader_integration_kit.enum.ble_data_type import BleDataType
4
+ from reader_integration_kit.enum.checkpoint_type import CheckpointType
5
+ from reader_integration_kit.enum.led_color import LedColor
6
+ from reader_integration_kit.enum.protocol_type import ProtocolType
7
+ from reader_integration_kit.enum.reader_module_id import ReaderModuleId
8
+ from reader_integration_kit.enum.reader_module_state import ReaderModuleState
9
+ from reader_integration_kit.enum.proximity_card_type import ProximityCardType
10
+ from reader_integration_kit.enum.serial_port_baud_rate import SerialPortBaudRate
11
+ from reader_integration_kit.enum.serial_port_data_bits import SerialPortDataBits
12
+ from reader_integration_kit.enum.serial_port_flow_control import SerialPortFlowControl
13
+ from reader_integration_kit.enum.serial_port_parity import SerialPortParity
14
+ from reader_integration_kit.enum.serial_port_stop_bits import SerialPortStopBits
15
+ from reader_integration_kit.enum.data_conversion_type import DataConversionType
16
+ from reader_integration_kit.enum.field_definition_type import FieldDefinitionType
17
+ from reader_integration_kit.enum.blob_type import BlobType
18
+ from reader_integration_kit.enum.transparent_mode_state import TransparentModeState
19
+ from reader_integration_kit.enum.transparent_mode_status import TransparentModeStatus
20
+
21
+ __all__ = [
22
+ 'BeepDuration', 'BeepVolume', 'BleDataType', 'CheckpointType', 'LedColor', 'ProtocolType',
23
+ 'ProximityCardType', 'ReaderModuleId', 'ReaderModuleState',
24
+ 'SerialPortBaudRate', 'SerialPortDataBits', 'SerialPortFlowControl',
25
+ 'SerialPortParity', 'SerialPortStopBits', 'DataConversionType',
26
+ 'FieldDefinitionType', 'BlobType', 'TransparentModeState',
27
+ 'TransparentModeStatus'
28
+ ]
@@ -0,0 +1,12 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class BeepDuration(enum.IntEnum):
6
+ BEEP_DURATION_SHORT = 0
7
+ BEEP_DURATION_LONG = 1
8
+
9
+ @classmethod
10
+ def from_param(cls, obj):
11
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
12
+
@@ -0,0 +1,15 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class BeepVolume(enum.IntEnum):
6
+ BEEP_VOLUME_OFF = 0
7
+ BEEP_VOLUME_LOW = 1
8
+ BEEP_VOLUME_MEDIUM = 2
9
+ BEEP_VOLUME_HIGH = 3
10
+ BEEP_VOLUME_UNKNOWN = 255
11
+
12
+ @classmethod
13
+ def from_param(cls, obj):
14
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
15
+
@@ -0,0 +1,12 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class BleDataType(enum.IntEnum):
6
+ DATA = 1
7
+ KEY = 2
8
+ UNENCRYPTED_KEY = 3
9
+
10
+ @classmethod
11
+ def from_param(cls, obj):
12
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,27 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+ class BlobType(enum.IntEnum):
5
+ LEGACY_KEY = 1
6
+ MIFARE_FILE = 2
7
+ LEGIC_FILE = 4
8
+ LEGIC_KEY = 5
9
+ LEGIC_FILE_WITH_USER_KEY = 6
10
+ MIFARE_KEY = 7
11
+ MIFARE_DESFIRE_FILE = 8
12
+ MIFARE_CLASSIC = 9
13
+ MIFARE_PLUS = 10
14
+ ECP_2_0 = 11
15
+ MIFARE_ULTRALIGHT = 14
16
+ HOST_ENCRYPTION_KEY = 15
17
+ WAVELYNX_MYPASS_BLE = 18
18
+ FELICA_LITE_S = 20
19
+ FELICA_LITE = 21
20
+ FELICA_KEY = 22
21
+ FELICA_FILE = 23
22
+ ALLEGION_HCE = 26
23
+ MIFARE_2GO = 27
24
+
25
+ @classmethod
26
+ def from_param(cls, obj):
27
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,13 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class CheckpointType(enum.IntEnum):
6
+ UNDEFINED = 0
7
+ FACTORY_DEFAULTS = 1
8
+ USER_SETTINGS = 2
9
+ RESERVED = 0xFF
10
+
11
+ @classmethod
12
+ def from_param(cls, obj):
13
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,12 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+ class DataConversionType(enum.IntEnum):
5
+ DECIMAL = 0
6
+ ASCII = 1
7
+ HEXADECIMAL = 2
8
+ OCTAL = 3
9
+
10
+ @classmethod
11
+ def from_param(cls, obj):
12
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,14 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+ class FieldDefinitionType(enum.IntEnum):
5
+ USER_FIELDS = 0
6
+ FIPS201_64_BIT = 1
7
+ FIPS201_64_BIT_REV = 2
8
+ FIPS201_75_BIT = 3
9
+ FIPS201_200_BIT = 4
10
+ FIPS201_245_BIT = 5
11
+
12
+ @classmethod
13
+ def from_param(cls, obj):
14
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,15 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class LedColor(enum.IntEnum):
6
+ INVALID = 0
7
+ OFF = 1
8
+ RED = 2
9
+ GREEN = 3
10
+ AMBER = 4
11
+ UNKNOWN = 0xff
12
+
13
+ @classmethod
14
+ def from_param(cls, obj):
15
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,14 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class ProtocolType(enum.IntEnum):
6
+ INVALID = 0x00
7
+ FEATURE_REPORT = 0x01
8
+ SERIAL_BINARY = 0x03
9
+ UNKNOWN = 0xFF
10
+
11
+ @classmethod
12
+ def from_param(cls, obj):
13
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
14
+
@@ -0,0 +1,166 @@
1
+ """
2
+ ProximityCardType enum for representing card types supported by readers.
3
+ """
4
+ from enum import IntEnum
5
+
6
+
7
+ class ProximityCardType(IntEnum):
8
+ """
9
+ Proximity card types supported by readers.
10
+ Each value represents a 16-bit card type code as returned by the reader firmware.
11
+ """
12
+ OFF = 0x0000
13
+
14
+ # HID 13.56 MHz Cards
15
+ HID_ICLASS_ID = 0x0100
16
+ HID_SEOS = 0x0101
17
+ HID_APPLE_WALLET = 0x0102
18
+
19
+ # MIFARE Secure File Data
20
+ MIFARE_CLASSIC_SECURE_FILE_DATA = 0x0301
21
+ MIFARE_DESFIRE_SECURE_FILE_DATA = 0x0201
22
+ MIFARE_DESFIRE_CSN_PLUS_SECURE_FILE = 0x0202
23
+ MIFARE_DESFIRE_SECURE_FILE_DATA_NESTLE = 0x0203
24
+ MIFARE_PLUS_SECURE_FILE_DATA = 0x0601
25
+ MIFARE_ULTRALIGHT_SECURE_FILE_DATA = 0x0501
26
+ MIFARE_2GO = 0x030E
27
+ ECP_2_0 = 0x030D
28
+ ALLEGION_HCE = 0x0206
29
+
30
+ # Gematik & PIV
31
+ GEMATIK_ICCSN = 0x0401
32
+
33
+ # FeliCa
34
+ FELICA_DATA_STANDARD = 0x0701
35
+ FELICA_DATA_LITE = 0x0702
36
+
37
+ # LEGIC
38
+ LEGIC_NEON = 0x0801
39
+ LEGIC_NEON_BLE = 0x0802
40
+
41
+ # FIDO2/U2F
42
+ FIDO2_U2F = 0x6F00
43
+
44
+ # RDR-758x Equivalents
45
+ RDR_758X_EQUIVALENT = 0x6F01
46
+ RDR_758X_EXPANDED_CSN = 0x6F02
47
+ RDR_758X_EXPANDED_FOR_LEGIC = 0x6F03
48
+
49
+ # PIV
50
+ PIV_UNIQUE_CARD_HOLDER_IDENTIFIER = 0x7702
51
+ FICAM = 0x7701
52
+
53
+ # LEGIC CSN
54
+ LEGIC_RF_STANDARD_PRIME_CSN = 0x7901
55
+ LEGIC_STAMP = 0x7803
56
+
57
+ # CEPAS
58
+ CEPAS = 0x7A01
59
+
60
+ # ISO 14443B
61
+ ISO_14443B_CSN = 0x7B01
62
+ ISO_14443B_SRX_CSN = 0x7B02
63
+
64
+ # FeliCa CSN
65
+ FELICA_CSN = 0x7C02
66
+
67
+ # HID iCLASS CSN
68
+ HID_ICLASS_CSN = 0x7D01
69
+
70
+ # I-Code & ISO 15693
71
+ I_CODE_CSN = 0x7E01
72
+ ETAG_CSN = 0x7E31
73
+ ISO_15693_CSN = 0x7E21
74
+ MY_D_CSN = 0x7E11
75
+ TAG_IT_CSN = 0x7E41
76
+ LEGIC_ADVANT_15693_CSN = 0x7E51
77
+
78
+ # DESFire, MIFARE, Topaz, I-tag, LEGIC
79
+ DESFIRE_CSN = 0x7F01
80
+ TOPAZ_CSN = 0x7F02
81
+ MIFARE_32_DOWNLOADER = 0x7F06
82
+ MIFARE_48_DOWNLOADER = 0x7F07
83
+ MIFARE_56_DOWNLOADER = 0x7F08
84
+ MIFARE_32_ATS8600 = 0x7F09
85
+ MIFARE_48_ATS8600 = 0x7F0A
86
+ MIFARE_56_ATS8600 = 0x7F0B
87
+ I_TAG_CSN = 0x7F11
88
+ ISO_14443A_CSN = 0x7F21
89
+ LEGIC_ADVANT_14443A_CSN = 0x7F31
90
+ MIFARE_CSN = 0x7F41
91
+ MIFARE_ULTRALIGHT_CSN = 0x7F51
92
+
93
+ # TCOS
94
+ TCOS = 0x7801
95
+
96
+ # Bluetooth/Mobile
97
+ ORANGE_PACK_ID = 0x8001
98
+ MOBILE_CREDENTIAL = 0x8101
99
+ BLE_BEACON = 0x8201
100
+ SAFETRUST = 0x8401
101
+ HID_MOBILE_ACCESS = 0x8501
102
+ PSIA_PKOC = 0x8601
103
+ WAVELYNX_MY_PASS_ID = 0x8701
104
+ WAVELYNX_NFC_WALLET_PLUS_LEAF = 0x030F
105
+ WAVELYNX_NFC_WALLET = 0x0309
106
+
107
+ # 125 kHz Cards
108
+ NEDAP = 0xE301
109
+ ID_TECK = 0xE401
110
+ ID_TECK_ALTERNATE = 0xE402
111
+ ID_TECK_LEGACY_PLUS = 0xE403
112
+ CDVI = 0xE912
113
+ PARADOX = 0xE902
114
+ POSTECH = 0xE922
115
+ KERI = 0xEA01
116
+ KERI_PSC1_26_BIT = 0xEA02
117
+ KERI_NXT_UID = 0xEA01
118
+ FARPOINTE_DATA_PYRAMID_PSC1_26_BIT = 0xEA22
119
+ PYRAMID_PSC1_26_BIT = 0xEA12
120
+ PYRAMID_UID = 0xEA11
121
+ FARPOINTE_DATA_PYRAMID_UID = 0xEA21
122
+ SECURA_KEY_01 = 0xEC01
123
+ RADIO_KEY_02 = 0xEB02
124
+ INDALA_ASP_PLUS = 0xED02
125
+ INDALA_ASP_PLUS_CUSTOM = 0xED05
126
+ HID_PROX = 0xEF04
127
+ HID_PROX_UID = 0xEF01
128
+ READY_KEY_PRO_UID = 0xF004
129
+ DIMPNA = 0xF101
130
+ HI_TAG_2 = 0xF201
131
+ HI_TAG_2_ALTERNATE = 0xF204
132
+ HI_TAG_2_ATS8600 = 0xF205
133
+ HI_TAG_2_DOWNLOADER = 0xF206
134
+ HI_TAG_1_AND_S = 0xF302
135
+ HI_TAG_1_AND_S_ALTERNATE = 0xF304
136
+ DEISTER = 0xF401
137
+ G_PROX_II_UID_RDR_6G8X = 0xF502
138
+ G_PROX_II_UID = 0xF503
139
+ G_PROX_II_ID = 0xF504
140
+ CARDAX = 0xF602
141
+ RUSSWIN = 0xF612
142
+ NEXWATCH_HONEYWELL = 0xF712
143
+ NEX_KEY_QUADRAKEY_KEY_MATE_2_SMART_KEY = 0xF722
144
+ NEX_KEY_QUADRAKEY_KEY_MATE_2_SMART_KEY_NEX_WATCH = 0xF702
145
+ KERI_UID_RDR_6K8X = 0xF802
146
+ KERI_UID = 0xF801
147
+ IO_PROX_KANTECH = 0xF902
148
+ IO_PROX_KANTECH_ALTERNATE = 0xF903
149
+ AWID = 0xFA02
150
+ ISONAS = 0xFA03
151
+ EM410X = 0xFB01
152
+ EM410X_ALTERNATE = 0xFB02
153
+ EM410X_WITH_CHECKSUM = 0xFB03
154
+ DIGITAG = 0xFB11
155
+ ROSSLARE = 0xFB21
156
+ CASI_RUSCO = 0xFC02
157
+ URMET = 0xFC03
158
+ INDALA_ASP_26_BIT = 0xFD02
159
+ INDALA_ASP_UID = 0xFD01
160
+ INDALA_ASP_CUSTOM = 0xFD04
161
+ INDALA_ECR_CUSTOM = 0xFD05
162
+ LF_COMPOSITE = 0xDE01
163
+ COTAG = 0xDF01
164
+
165
+ # Unknown/Invalid
166
+ UNKNOWN = 0xFFFF
@@ -0,0 +1,13 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class ReaderModuleId(enum.IntEnum):
6
+ INVALID = 0x00
7
+ LOW_FREQUENCY_RADIO = 0x01
8
+ HIGH_FREQUENCY_RADIO = 0x02
9
+ BLE_RADIO = 0x03
10
+
11
+ @classmethod
12
+ def from_param(cls, obj):
13
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,12 @@
1
+ import enum
2
+ from ctypes import c_uint32
3
+
4
+
5
+ class ReaderModuleState(enum.IntEnum):
6
+ INVALID = 0x00
7
+ POWER_OFF = 0x00000080
8
+ POWER_ON_NORMAL = 0x00000081
9
+
10
+ @classmethod
11
+ def from_param(cls, obj):
12
+ return c_uint32(obj)
@@ -0,0 +1,15 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SerialPortBaudRate(IntEnum):
5
+ INVALID = 0
6
+ BAUD_9600 = 9600
7
+ BAUD_14400 = 14400
8
+ BAUD_32400 = 32400
9
+ BAUD_19200 = 19200
10
+ BAUD_57600 = 57600
11
+ BAUD_115200 = 115200
12
+ BAUD_230400 = 230400
13
+ BAUD_576000 = 576000
14
+ BAUD_921600 = 921600
15
+
@@ -0,0 +1,10 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SerialPortDataBits(IntEnum):
5
+ INVALID = 0
6
+ DATA_BITS_5 = 1
7
+ DATA_BITS_6 = 2
8
+ DATA_BITS_7 = 3
9
+ DATA_BITS_8 = 4
10
+
@@ -0,0 +1,11 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SerialPortFlowControl(IntEnum):
5
+ NO_FLOW_CONTROL = 0
6
+ XON_XOFF = 1
7
+ RTS_CTS = 2
8
+ XON_XOFF_RTS_CTS = 3
9
+ DTR_DSR = 4
10
+ XON_XOFF_DTR_DSR = 5
11
+
@@ -0,0 +1,10 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SerialPortParity(IntEnum):
5
+ NONE = 0
6
+ ODD = 1
7
+ EVEN = 2
8
+ MARK = 3
9
+ SPACE = 4
10
+
@@ -0,0 +1,9 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SerialPortStopBits(IntEnum):
5
+ NONE = 0
6
+ ONE = 1
7
+ TWO = 2
8
+ ONE_POINT_FIVE = 3
9
+
@@ -0,0 +1,11 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class TransparentModeState(enum.IntEnum):
6
+ DISABLED = 0
7
+ ENABLED = 1
8
+
9
+ @classmethod
10
+ def from_param(cls, obj):
11
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,11 @@
1
+ import enum
2
+ from ctypes import c_uint8
3
+
4
+
5
+ class TransparentModeStatus(enum.IntEnum):
6
+ NOT_READY = 0
7
+ READY = 1
8
+
9
+ @classmethod
10
+ def from_param(cls, obj):
11
+ return c_uint8(obj.value if isinstance(obj, cls) else obj)
@@ -0,0 +1,4 @@
1
+ from reader_integration_kit.errors.reader_exception import ReaderException
2
+
3
+ __all__ = ['ReaderException']
4
+
@@ -0,0 +1,58 @@
1
+ from reader_integration_kit.structures.rik_result import RikResult
2
+
3
+
4
+ class ReaderException(Exception):
5
+ """Exception class for Reader layer errors."""
6
+
7
+ def __init__(self, result: RikResult):
8
+ self._has_exception = result.has_exception
9
+ self._exception_type = result.exception_type
10
+ self._message = result.message
11
+ self._function_name = result.function_name
12
+ self._line_number = result.line_number
13
+ self._file_name = result.file_name
14
+ self._has_protocol_exception = result.has_protocol_exception
15
+ self._protocol_exception_type = result.protocol_exception_type
16
+ self._protocol_message = result.protocol_message
17
+ self._protocol_file_name = result.protocol_file_name
18
+ self._protocol_line_number = result.protocol_line_number
19
+ self._protocol_function_name = result.protocol_function_name
20
+
21
+ # Build the main message
22
+ msg = f"Reader Exception: {self._exception_type}"
23
+ if self._message:
24
+ msg += f" - {self._message}"
25
+ if self._has_protocol_exception:
26
+ msg += f" [Protocol Exception: {self._protocol_exception_type}"
27
+ if self._protocol_message:
28
+ msg += f" - {self._protocol_message}"
29
+ msg += "]"
30
+
31
+ super().__init__(msg)
32
+ self.message = msg
33
+
34
+ def __str__(self):
35
+ return self.message
36
+
37
+ @property
38
+ def has_protocol_exception(self) -> bool:
39
+ """Check if this exception includes protocol exception information."""
40
+ return self._has_protocol_exception
41
+
42
+ @property
43
+ def protocol_exception_type(self) -> str:
44
+ """Get protocol exception type (only valid if has_protocol_exception is True)."""
45
+ return self._protocol_exception_type
46
+
47
+ @property
48
+ def protocol_message(self) -> str:
49
+ """Get protocol exception message (only valid if has_protocol_exception is True)."""
50
+ return self._protocol_message
51
+
52
+ @classmethod
53
+ def raise_if_error(cls, result: RikResult) -> RikResult:
54
+ """Raise an exception if the result indicates an error."""
55
+ if result.has_exception:
56
+ raise ReaderException(result)
57
+ return result
58
+