DLMS-SPODES 0.87.16__py3-none-any.whl → 0.88.1__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.
- DLMS_SPODES/Values/EN/__init__.py +1 -1
- DLMS_SPODES/Values/EN/actors.py +8 -8
- DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
- DLMS_SPODES/Values/RU/__init__.py +1 -1
- DLMS_SPODES/Values/RU/actors.py +8 -8
- DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
- DLMS_SPODES/__init__.py +6 -6
- DLMS_SPODES/configEN.ini +126 -126
- DLMS_SPODES/config_parser.py +53 -53
- DLMS_SPODES/cosem_interface_classes/Overview/__init__.py +0 -0
- DLMS_SPODES/cosem_interface_classes/Overview/class_id.py +107 -0
- DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +3 -2
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +210 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +78 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +50 -34
- DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
- DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +440 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +126 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +30 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +3 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +14 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +81 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2106 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +525 -583
- DLMS_SPODES/cosem_interface_classes/data.py +12 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +32 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +56 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +18 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +33 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +78 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +42 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +6 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +27 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +9 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +54 -126
- DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
- DLMS_SPODES/cosem_interface_classes/implementations/data.py +491 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +85 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +42 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +77 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +334 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +51 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +27 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +48 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +28 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +198 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +548 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +90 -122
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +268 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +13 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +9 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +124 -166
- DLMS_SPODES/cosem_interface_classes/register.py +18 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +45 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +33 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +72 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +88 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +54 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +45 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +122 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +34 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +54 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +20 -42
- DLMS_SPODES/cosem_pdu.py +93 -93
- DLMS_SPODES/enums.py +625 -625
- DLMS_SPODES/exceptions.py +106 -106
- DLMS_SPODES/firmwares.py +99 -99
- DLMS_SPODES/hdlc/frame.py +875 -875
- DLMS_SPODES/hdlc/sub_layer.py +54 -54
- DLMS_SPODES/literals.py +17 -17
- DLMS_SPODES/obis/__init__.py +1 -1
- DLMS_SPODES/obis/media_id.py +931 -931
- DLMS_SPODES/pardata.py +22 -22
- DLMS_SPODES/pdu_enums.py +98 -98
- DLMS_SPODES/relation_to_OBIS.py +463 -465
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +140 -142
- DLMS_SPODES/types/common_data_types.py +2379 -2401
- DLMS_SPODES/types/cosem_service_types.py +109 -109
- DLMS_SPODES/types/implementations/arrays.py +25 -25
- DLMS_SPODES/types/implementations/bitstrings.py +97 -97
- DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
- DLMS_SPODES/types/implementations/enums.py +57 -57
- DLMS_SPODES/types/implementations/integers.py +12 -11
- DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
- DLMS_SPODES/types/implementations/octet_string.py +11 -11
- DLMS_SPODES/types/implementations/structs.py +64 -64
- DLMS_SPODES/types/type_alias.py +74 -0
- DLMS_SPODES/types/useful_types.py +627 -677
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/METADATA +30 -30
- dlms_spodes-0.88.1.dist-info/RECORD +118 -0
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/WHEEL +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +0 -20
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +0 -12
- dlms_spodes-0.87.16.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
from . import ver0
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from ...types import cdt
|
|
4
|
+
from ..cosem_interface_class import ICAElement, Classifier
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PSStatus(cdt.Enum, elements=tuple(range(7))):
|
|
8
|
+
""" Indicates the packet switched status of the modem. """
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CellInfoType(cdt.Structure):
|
|
12
|
+
""" Params of element """
|
|
13
|
+
cell_ID: cdt.DoubleLongUnsigned
|
|
14
|
+
location_ID: cdt.LongUnsigned
|
|
15
|
+
signal_quality: ver0.SignalQuality
|
|
16
|
+
ber: cdt.Unsigned
|
|
17
|
+
mcc: cdt.LongUnsigned
|
|
18
|
+
mnc: cdt.LongUnsigned
|
|
19
|
+
channel_number: cdt.DoubleLongUnsigned
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AdjacentCellInfo(cdt.Structure):
|
|
23
|
+
cell_ID: cdt.DoubleLongUnsigned
|
|
24
|
+
signal_quality: ver0.SignalQuality
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class AdjacentCells(cdt.Array):
|
|
28
|
+
TYPE = AdjacentCellInfo
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class GSMDiagnostic(ver0.GSMDiagnostic):
|
|
32
|
+
VERSION = 1
|
|
33
|
+
A_ELEMENTS = (ver0.GSMDiagnostic.getAElement(2).unwrap(),
|
|
34
|
+
ver0.GSMDiagnostic.getAElement(3).unwrap(),
|
|
35
|
+
ver0.GSMDiagnostic.getAElement(4).unwrap(),
|
|
36
|
+
ICAElement(5, "ps_status", PSStatus, 0, 255, 0, classifier=Classifier.DYNAMIC),
|
|
37
|
+
ICAElement(6, "cell_info", CellInfoType, classifier=Classifier.DYNAMIC),
|
|
38
|
+
ICAElement(7, "adjacent_cell", AdjacentCells, classifier=Classifier.DYNAMIC),
|
|
39
|
+
ver0.GSMDiagnostic.getAElement(8).unwrap())
|
|
40
|
+
ps_status: Optional[PSStatus]
|
|
41
|
+
cell_info: Optional[CellInfoType]
|
|
42
|
+
adjacent_cell: Optional[AdjacentCells]
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class GSMDiagnostic(
|
|
5
|
-
def __new__(cls, *args, **kwargs):
|
|
6
|
-
raise ValueError(F"version: {__name__[-1]} of {cls.__class__.__name__} not support framework")
|
|
7
|
-
|
|
8
|
-
def characteristics_init(self):
|
|
9
|
-
""" initiate all attributes and methods of class """
|
|
1
|
+
from . import ver1
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class GSMDiagnostic(ver1.GSMDiagnostic):
|
|
5
|
+
def __new__(cls, *args, **kwargs):
|
|
6
|
+
raise ValueError(F"version: {__name__[-1]} of {cls.__class__.__name__} not support framework")
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from ..
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def
|
|
11
|
-
"
|
|
1
|
+
from ..cosem_interface_class import ICAElement, Classifier, ICAuto
|
|
2
|
+
from ..Overview import class_id
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class IECHDLCSetup(ICAuto):
|
|
6
|
+
CLASS_ID = class_id.IEC_HDLC_SETUP
|
|
7
|
+
A_ELEMENTS = ()
|
|
8
|
+
M_ELEMENTS = ()
|
|
9
|
+
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
raise ValueError(F"version: {__name__[-1]} of {cls.__class__.__name__} not support framework")
|
|
@@ -1,53 +1,27 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from ...types.implementations.enums import CommSpeed
|
|
4
|
-
from ..
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def windows_size_transmit(self) -> cdt.Unsigned:
|
|
29
|
-
return self.get_attr(3)
|
|
30
|
-
|
|
31
|
-
@property
|
|
32
|
-
def windows_size_receive(self) -> cdt.Unsigned:
|
|
33
|
-
return self.get_attr(4)
|
|
34
|
-
|
|
35
|
-
@property
|
|
36
|
-
def max_info_field_length_transmit(self) -> cdt.LongUnsigned:
|
|
37
|
-
return self.get_attr(5)
|
|
38
|
-
|
|
39
|
-
@property
|
|
40
|
-
def max_info_field_length_receive(self) -> cdt.LongUnsigned:
|
|
41
|
-
return self.get_attr(6)
|
|
42
|
-
|
|
43
|
-
@property
|
|
44
|
-
def inter_octet_time_out(self) -> cdt.LongUnsigned:
|
|
45
|
-
return self.get_attr(7)
|
|
46
|
-
|
|
47
|
-
@property
|
|
48
|
-
def inactivity_time_out(self) -> cdt.LongUnsigned:
|
|
49
|
-
return self.get_attr(8)
|
|
50
|
-
|
|
51
|
-
@property
|
|
52
|
-
def device_address(self) -> cdt.LongUnsigned:
|
|
53
|
-
return self.get_attr(9)
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from ...types import cdt
|
|
3
|
+
from ...types.implementations.enums import CommSpeed
|
|
4
|
+
from ..cosem_interface_class import ICAElement, ICAuto
|
|
5
|
+
from ..Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class IECHDLCSetup(ICAuto):
|
|
9
|
+
"""4.7.2 IEC HDLC setup"""
|
|
10
|
+
CLASS_ID = class_id.IEC_HDLC_SETUP
|
|
11
|
+
VERSION = 1
|
|
12
|
+
A_ELEMENTS = (ICAElement(2, "comm_speed", CommSpeed, 0, 9, 5),
|
|
13
|
+
ICAElement(3, "windows_size_transmit", cdt.Unsigned, 1, 7, 1),
|
|
14
|
+
ICAElement(4, "windows_size_receive", cdt.Unsigned, 1, 7, 1),
|
|
15
|
+
ICAElement(5, "max_info_field_length_transmit", cdt.LongUnsigned, 128, 32, 2030),
|
|
16
|
+
ICAElement(6, "max_info_field_length_receive", cdt.LongUnsigned, 128, 32, 2030),
|
|
17
|
+
ICAElement(7, "inter_octet_time_out", cdt.LongUnsigned, 20, 6000, 25),
|
|
18
|
+
ICAElement(8, "inactivity_time_out", cdt.LongUnsigned, 0, default=120),
|
|
19
|
+
ICAElement(9, "device_address", cdt.LongUnsigned, 0x0001, 0x3ffd, default=0x10)) # TODO: not according by BlueBook: need default, minimum is other
|
|
20
|
+
comm_speed: Optional[CommSpeed]
|
|
21
|
+
windows_size_transmit: Optional[cdt.Unsigned]
|
|
22
|
+
windows_size_receive: Optional[cdt.Unsigned]
|
|
23
|
+
max_info_field_length_transmit: Optional[cdt.LongUnsigned]
|
|
24
|
+
max_info_field_length_receive: Optional[cdt.LongUnsigned]
|
|
25
|
+
inter_octet_time_out: Optional[cdt.LongUnsigned]
|
|
26
|
+
inactivity_time_out: Optional[cdt.LongUnsigned]
|
|
27
|
+
device_address: Optional[cdt.LongUnsigned]
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
from
|
|
2
|
-
from .
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class IECLocalPortSetup(
|
|
6
|
-
""" This IC allows modelling the configuration of communication ports using the protocols specified in IEC 62056-21:2002. Several ports can be configured. """
|
|
7
|
-
CLASS_ID =
|
|
8
|
-
VERSION =
|
|
9
|
-
|
|
10
|
-
def characteristics_init(self) -> None:
|
|
11
|
-
"""# TODO: not released ... """
|
|
1
|
+
from .cosem_interface_class import ICAuto, Cardinality
|
|
2
|
+
from .Overview import class_id
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class IECLocalPortSetup(ICAuto):
|
|
6
|
+
""" This IC allows modelling the configuration of communication ports using the protocols specified in IEC 62056-21:2002. Several ports can be configured. """
|
|
7
|
+
CLASS_ID = class_id.IEC_LOCAL_PORT_SETUP
|
|
8
|
+
VERSION = 1
|
|
9
|
+
CARDINALITY = Cardinality()
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
from ...types import cdt
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ImageTransferStatus(cdt.Enum, elements=tuple(range(8))):
|
|
5
|
-
""" Holds the status of the Image transfer process. """
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
TRANSFER_NOT_INITIATED = ImageTransferStatus(0)
|
|
9
|
-
TRANSFER_INITIATED = ImageTransferStatus(1)
|
|
10
|
-
VERIFICATION_INITIATED = ImageTransferStatus(2)
|
|
11
|
-
VERIFICATION_SUCCESSFUL = ImageTransferStatus(3)
|
|
12
|
-
VERIFICATION_FAILED = ImageTransferStatus(4)
|
|
13
|
-
ACTIVATION_INITIATED = ImageTransferStatus(5)
|
|
14
|
-
ACTIVATION_SUCCESSFUL = ImageTransferStatus(6)
|
|
15
|
-
ACTIVATION_FAILED = ImageTransferStatus(7)
|
|
1
|
+
from ...types import cdt
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ImageTransferStatus(cdt.Enum, elements=tuple(range(8))):
|
|
5
|
+
""" Holds the status of the Image transfer process. """
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
TRANSFER_NOT_INITIATED = ImageTransferStatus(0)
|
|
9
|
+
TRANSFER_INITIATED = ImageTransferStatus(1)
|
|
10
|
+
VERIFICATION_INITIATED = ImageTransferStatus(2)
|
|
11
|
+
VERIFICATION_SUCCESSFUL = ImageTransferStatus(3)
|
|
12
|
+
VERIFICATION_FAILED = ImageTransferStatus(4)
|
|
13
|
+
ACTIVATION_INITIATED = ImageTransferStatus(5)
|
|
14
|
+
ACTIVATION_SUCCESSFUL = ImageTransferStatus(6)
|
|
15
|
+
ACTIVATION_FAILED = ImageTransferStatus(7)
|
|
@@ -1,126 +1,54 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
DEFAULT = (bytearray(b'default'), 0)
|
|
25
|
-
image_identifier: cdt.OctetString
|
|
26
|
-
image_size: cdt.DoubleLongUnsigned
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class ImageBlockTransfer(cdt.Structure):
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
""" container of blocks for transfer """
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def image_block_size(self) -> cdt.DoubleLongUnsigned:
|
|
59
|
-
return self.get_attr(2)
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def image_transferred_blocks_status(self) -> cdt.BitString:
|
|
63
|
-
return self.get_attr(3)
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def image_first_not_transferred_block_number(self) -> cdt.DoubleLongUnsigned:
|
|
67
|
-
return self.get_attr(4)
|
|
68
|
-
|
|
69
|
-
@property
|
|
70
|
-
def image_transfer_enabled(self) -> cdt.Boolean:
|
|
71
|
-
return self.get_attr(5)
|
|
72
|
-
|
|
73
|
-
@property
|
|
74
|
-
def image_transfer_status(self) -> ImageTransferStatus:
|
|
75
|
-
return self.get_attr(6)
|
|
76
|
-
|
|
77
|
-
@property
|
|
78
|
-
def image_to_activate_info(self) -> ImageToActivateInfo:
|
|
79
|
-
return self.get_attr(7)
|
|
80
|
-
|
|
81
|
-
@property
|
|
82
|
-
def image_transfer_initiate(self) -> ImageTransferInitiate:
|
|
83
|
-
return self.get_meth(1)
|
|
84
|
-
|
|
85
|
-
@property
|
|
86
|
-
def image_block_transfer(self) -> ImageBlockTransfer:
|
|
87
|
-
return self.get_meth(2)
|
|
88
|
-
|
|
89
|
-
@property
|
|
90
|
-
def image_verify(self) -> integers.Only0:
|
|
91
|
-
return self.get_meth(3)
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def image_activate(self) -> integers.Only0:
|
|
95
|
-
return self.get_meth(4)
|
|
96
|
-
|
|
97
|
-
@property
|
|
98
|
-
def current_block_transfer(self) -> int:
|
|
99
|
-
return int(self.image_block_transfer.image_block_number)
|
|
100
|
-
|
|
101
|
-
def get_n_blocks(self) -> int:
|
|
102
|
-
"""get sum of blocks"""
|
|
103
|
-
return len(self.__blocks_for_update)
|
|
104
|
-
|
|
105
|
-
def set_next_block(self):
|
|
106
|
-
""" set next block transfer """
|
|
107
|
-
try:
|
|
108
|
-
# TODO: USE bitstring of BlockStatus if it exist(length order by image) for pretty next block
|
|
109
|
-
self.set_block_for_transfer(self.current_block_transfer+1)
|
|
110
|
-
except IndexError:
|
|
111
|
-
raise StopIteration
|
|
112
|
-
|
|
113
|
-
def set_block_for_transfer(self, index: int):
|
|
114
|
-
""" set block transfer number. IndexError if index more when blocks size """
|
|
115
|
-
if index > (len(self.__blocks_for_update) - 1):
|
|
116
|
-
raise IndexError(F"got block {index=}, expected 0..{len(self.__blocks_for_update)-1}")
|
|
117
|
-
self.image_block_transfer.set((index, self.__blocks_for_update[index]))
|
|
118
|
-
|
|
119
|
-
@property
|
|
120
|
-
def is_image_exist(self) -> bool:
|
|
121
|
-
""" show is existing image in container """
|
|
122
|
-
return bool(len(self.__blocks_for_update))
|
|
123
|
-
|
|
124
|
-
def clear_image(self):
|
|
125
|
-
""" clear image container """
|
|
126
|
-
self.__blocks_for_update.clear()
|
|
1
|
+
from ...types.implementations import integers
|
|
2
|
+
from . image_transfer_status import ImageTransferStatus
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from ...types import cdt
|
|
5
|
+
from ..cosem_interface_class import ICAElement, ICMElement, ICAuto, Classifier
|
|
6
|
+
from ..Overview import class_id
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ImageToActivateInfoElement(cdt.Structure):
|
|
10
|
+
"""image_to_activate_info_element"""
|
|
11
|
+
image_to_activate_size: cdt.DoubleLongUnsigned
|
|
12
|
+
image_to_activate_identification: cdt.OctetString
|
|
13
|
+
image_to_activate_signature: cdt.OctetString
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ImageToActivateInfo(cdt.Array):
|
|
17
|
+
"""image_to_activate_info attribute"""
|
|
18
|
+
TYPE = ImageToActivateInfoElement
|
|
19
|
+
__getitem__: ImageToActivateInfoElement
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ImageTransferInitiate(cdt.Structure):
|
|
23
|
+
"""image_transfer_initiate method"""
|
|
24
|
+
DEFAULT = (bytearray(b'default'), 0)
|
|
25
|
+
image_identifier: cdt.OctetString
|
|
26
|
+
image_size: cdt.DoubleLongUnsigned
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ImageBlockTransfer(cdt.Structure):
|
|
30
|
+
"""image_block_transfer method"""
|
|
31
|
+
image_block_number: cdt.DoubleLongUnsigned
|
|
32
|
+
image_block_value: cdt.OctetString
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ImageTransfer(ICAuto):
|
|
36
|
+
"""4.4.6 Image transfer"""
|
|
37
|
+
CLASS_ID = class_id.IMAGE_TRANSFER
|
|
38
|
+
VERSION = 0
|
|
39
|
+
A_ELEMENTS = (ICAElement(2, "image_block_size", cdt.DoubleLongUnsigned),
|
|
40
|
+
ICAElement(3, "image_transferred_blocks_status", cdt.BitString, classifier=Classifier.DYNAMIC),
|
|
41
|
+
ICAElement(4, "image_first_not_transferred_block_number", cdt.DoubleLongUnsigned, classifier=Classifier.DYNAMIC),
|
|
42
|
+
ICAElement(5, "image_transfer_enabled", cdt.Boolean),
|
|
43
|
+
ICAElement(6, "image_transfer_status", ImageTransferStatus, classifier=Classifier.DYNAMIC),
|
|
44
|
+
ICAElement(7, "image_to_activate_info", ImageToActivateInfo, classifier=Classifier.DYNAMIC))
|
|
45
|
+
M_ELEMENTS = (ICMElement(1, "image_transfer_initiate", ImageTransferInitiate),
|
|
46
|
+
ICMElement(2, "image_block_transfer", ImageBlockTransfer),
|
|
47
|
+
ICMElement(3, "image_verify", integers.Only0),
|
|
48
|
+
ICMElement(4, "image_activate", integers.Only0))
|
|
49
|
+
image_block_size: Optional[cdt.DoubleLongUnsigned]
|
|
50
|
+
image_transferred_blocks_status: Optional[cdt.BitString]
|
|
51
|
+
image_first_not_transferred_block_number: Optional[cdt.DoubleLongUnsigned]
|
|
52
|
+
image_transfer_enabled: Optional[cdt.Boolean]
|
|
53
|
+
image_transfer_status: Optional[ImageTransferStatus]
|
|
54
|
+
image_to_activate_info: Optional[ImageToActivateInfo]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from . import data
|
|
2
|
-
from . import arbitrator
|
|
3
|
-
from . import profile_generic
|
|
1
|
+
from . import data
|
|
2
|
+
from . import arbitrator
|
|
3
|
+
from . import profile_generic
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
from ..arbitrator import Arbitrator
|
|
2
|
-
from ... import settings
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
match settings.get_current_language():
|
|
6
|
-
case settings.Language.ENGLISH: from ...Values.EN import actors
|
|
7
|
-
case settings.Language.RUSSIAN: from ...Values.RU import actors
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class SPODES3Arbitrator(Arbitrator):
|
|
11
|
-
"""Cosem3 7.3.18"""
|
|
12
|
-
actors = (actors.MANUAL,
|
|
13
|
-
actors.LOCAL_1,
|
|
14
|
-
actors.LOCAL_2,
|
|
15
|
-
actors.LOCAL_3,
|
|
16
|
-
actors.LOCAL_4,
|
|
17
|
-
actors.LOCAL_5,
|
|
18
|
-
actors.LOCAL_6,
|
|
19
|
-
actors.LOCAL_7)
|
|
1
|
+
from ..arbitrator import Arbitrator
|
|
2
|
+
from ... import settings
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
match settings.get_current_language():
|
|
6
|
+
case settings.Language.ENGLISH: from ...Values.EN import actors
|
|
7
|
+
case settings.Language.RUSSIAN: from ...Values.RU import actors
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SPODES3Arbitrator(Arbitrator):
|
|
11
|
+
"""Cosem3 7.3.18"""
|
|
12
|
+
actors = (actors.MANUAL,
|
|
13
|
+
actors.LOCAL_1,
|
|
14
|
+
actors.LOCAL_2,
|
|
15
|
+
actors.LOCAL_3,
|
|
16
|
+
actors.LOCAL_4,
|
|
17
|
+
actors.LOCAL_5,
|
|
18
|
+
actors.LOCAL_6,
|
|
19
|
+
actors.LOCAL_7)
|