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,68 +1,45 @@
|
|
|
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
|
-
CLASS_ID =
|
|
34
|
-
VERSION =
|
|
35
|
-
A_ELEMENTS = (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
M_ELEMENTS = (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@property
|
|
47
|
-
def security_policy(self) -> SecurityPolicy:
|
|
48
|
-
return self.get_attr(2)
|
|
49
|
-
|
|
50
|
-
@property
|
|
51
|
-
def security_suite(self) -> SecuritySuite:
|
|
52
|
-
return self.get_attr(3)
|
|
53
|
-
|
|
54
|
-
@property
|
|
55
|
-
def client_system_title(self) -> cdt.OctetString:
|
|
56
|
-
return self .get_attr(4)
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
def server_system_title(self) -> cdt.OctetString:
|
|
60
|
-
return self .get_attr(5)
|
|
61
|
-
|
|
62
|
-
@property
|
|
63
|
-
def security_activate(self) -> SecurityPolicy:
|
|
64
|
-
return self .get_meth(1)
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def global_key_transfer(self) -> GlobalKeyTransfer:
|
|
68
|
-
return self .get_meth(2)
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from ...types import cdt
|
|
3
|
+
from ..cosem_interface_class import ICAElement, ICMElement, Classifier, ICAuto
|
|
4
|
+
from ..Overview import class_id
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SecurityPolicy(cdt.Enum, elements=tuple(range(16))):
|
|
8
|
+
""" Enforces authentication and/or encrypting algorithm provided with security_suite """
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SecuritySuite(cdt.Enum, elements=tuple(range(16))):
|
|
12
|
+
"""Specifies authentication, encryption and key transport algorithm"""
|
|
13
|
+
AES_GCM_128_AUT_ENCR_AND_AES_128_KEY_WRAP = 0
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class KeyID(cdt.Enum, elements=(0, 1, 2)):
|
|
17
|
+
"""Use only in KeyData structure"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class KeyData(cdt.Structure):
|
|
21
|
+
""" TODO: """
|
|
22
|
+
key_id: KeyID
|
|
23
|
+
key_wrapped: cdt.OctetString
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class GlobalKeyTransfer(cdt.Array):
|
|
27
|
+
""" Array of key_data """
|
|
28
|
+
TYPE = KeyData
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SecuritySetup(ICAuto):
|
|
32
|
+
"""4.4.7 Security setup"""
|
|
33
|
+
CLASS_ID = class_id.SECURITY_SETUP
|
|
34
|
+
VERSION = 0
|
|
35
|
+
A_ELEMENTS = (ICAElement(2, "security_policy", SecurityPolicy, 0, 3, 0),
|
|
36
|
+
ICAElement(3, "security_suite", SecuritySuite, 0, 0, 0),
|
|
37
|
+
ICAElement(4, "client_system_title", cdt.OctetString, classifier=Classifier.DYNAMIC),
|
|
38
|
+
ICAElement(5, "server_system_title", cdt.OctetString))
|
|
39
|
+
|
|
40
|
+
M_ELEMENTS = (ICMElement(1, "security_activate", SecurityPolicy),
|
|
41
|
+
ICMElement(2, "global_key_transfer", GlobalKeyTransfer))
|
|
42
|
+
security_policy: Optional[SecurityPolicy]
|
|
43
|
+
security_suite: Optional[SecuritySuite]
|
|
44
|
+
client_system_title: Optional[cdt.OctetString]
|
|
45
|
+
server_system_title: Optional[cdt.OctetString]
|
|
@@ -1,158 +1,122 @@
|
|
|
1
|
-
from . import ver0
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
from ...types import
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
ver0.SecuritySetup.getAElement(
|
|
108
|
-
ver0.SecuritySetup.getAElement(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
self.set_attr(6, None)
|
|
124
|
-
|
|
125
|
-
@property
|
|
126
|
-
def security_policy(self) -> SecurityPolicyVer1:
|
|
127
|
-
return self.get_attr(2)
|
|
128
|
-
|
|
129
|
-
@property
|
|
130
|
-
def security_suite(self) -> SecuritySuite:
|
|
131
|
-
return self.get_attr(3)
|
|
132
|
-
|
|
133
|
-
@property
|
|
134
|
-
def certificates(self) -> Certificates:
|
|
135
|
-
return self.get_attr(6)
|
|
136
|
-
|
|
137
|
-
@property
|
|
138
|
-
def security_activate(self) -> SecurityPolicyVer1:
|
|
139
|
-
return self.get_meth(1)
|
|
140
|
-
|
|
141
|
-
@property
|
|
142
|
-
def key_transfer(self) -> KeyTransferData:
|
|
143
|
-
return self .get_meth(2)
|
|
144
|
-
|
|
145
|
-
def key_agreement(self) -> KeyAgreement:
|
|
146
|
-
return self .get_meth(3)
|
|
147
|
-
|
|
148
|
-
def generate_certificate_request(self) -> KeyPair:
|
|
149
|
-
return self .get_meth(4)
|
|
150
|
-
|
|
151
|
-
def import_certificate(self) -> cdt.OctetString:
|
|
152
|
-
return self .get_meth(5)
|
|
153
|
-
|
|
154
|
-
def export_certificate(self) -> CertificateIdentification:
|
|
155
|
-
return self .get_meth(6)
|
|
156
|
-
|
|
157
|
-
def remove_certificate(self) -> CertificateIdentification:
|
|
158
|
-
return self .get_meth(7)
|
|
1
|
+
from . import ver0
|
|
2
|
+
from ...types import choices
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from ...types import cdt, ut
|
|
5
|
+
from ..cosem_interface_class import ICAElement, ICMElement, Classifier
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SecurityPolicy(cdt.Enum, cdt.IntegerFlag):
|
|
9
|
+
""" security_policy"""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CertificateEntity(cdt.Enum, elements=(0, 1, 2, 3)):
|
|
13
|
+
"""TODO:"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CertificateType(cdt.Enum, elements=(0, 1, 2, 3)):
|
|
17
|
+
"""TODO:"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SecuritySuite(ver0.SecuritySuite, elements=(0, 1, 2)):
|
|
21
|
+
"""Version 0 extension"""
|
|
22
|
+
AES_GCM_128_AUT_ENCR_ECDSA_P_256_DIG_SIGN_ECDH_P_256_KEY_AGR_SHA_256_HASH_V44_COMPR_AND_AES_128_KEY_WRAP = 1
|
|
23
|
+
AES_GCM_256_AUT_ENCR_ECDSA_P_384_DIG_SIGN_ECDH_P_384_KEY_AGR_SHA_384_HASH_V44_COMPR_AND_AES_256_KEY_WRAP = 2
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CertificateInfo(cdt.Structure):
|
|
27
|
+
""" TODO: """
|
|
28
|
+
certificate_entity: CertificateEntity
|
|
29
|
+
certificate_type: CertificateType
|
|
30
|
+
serial_number: cdt.OctetString
|
|
31
|
+
issuer: cdt.OctetString
|
|
32
|
+
subject: cdt.OctetString
|
|
33
|
+
subject_alt_name: cdt.OctetString
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Certificates(cdt.Array):
|
|
37
|
+
"""Carries information on the X.509 v3 Certificates available and stored in the server"""
|
|
38
|
+
TYPE = CertificateInfo
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class KeyID(cdt.Enum, elements=(0, 1, 2, 3)):
|
|
42
|
+
"""Version 0 extension"""
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class KeyTransferData(cdt.Structure):
|
|
46
|
+
""" TODO: """
|
|
47
|
+
key_id: KeyID
|
|
48
|
+
key_wrapped: cdt.OctetString
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class KeyTransfer(cdt.Array):
|
|
52
|
+
""" Array of key_transfer_data """
|
|
53
|
+
TYPE = KeyTransferData
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class KeyAgreementData(cdt.Structure):
|
|
57
|
+
""" TODO: """
|
|
58
|
+
key_id: KeyID
|
|
59
|
+
key_data: cdt.OctetString
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class KeyAgreement(cdt.Array):
|
|
63
|
+
""" Array of key_agreement_data """
|
|
64
|
+
TYPE = KeyAgreementData
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class KeyPair(cdt.Enum, elements=(0, 1, 2)):
|
|
68
|
+
"""TODO:"""
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class CertificateIdentificationByEntity(cdt.Structure):
|
|
72
|
+
""" TODO: """
|
|
73
|
+
certificate_entity: CertificateEntity
|
|
74
|
+
certificate_type: CertificateType
|
|
75
|
+
system_title: cdt.OctetString
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class CertificateIdentificationBySerial(cdt.Structure):
|
|
79
|
+
""" TODO: """
|
|
80
|
+
serial_number: cdt.OctetString
|
|
81
|
+
issuer: cdt.OctetString
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class CertificateIdentificationType(cdt.Enum, elements=(0, 1)):
|
|
85
|
+
"""TODO:"""
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class CertificationIdentificationOption(ut.CHOICE):
|
|
89
|
+
TYPE = cdt.Structure
|
|
90
|
+
ELEMENTS = {0: ut.SequenceElement('by entity', CertificateIdentificationByEntity),
|
|
91
|
+
1: ut.SequenceElement('by serial', CertificateIdentificationBySerial)}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
certification_identification_option = CertificationIdentificationOption()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class CertificateIdentification(choices.StructureMixin, cdt.Structure):
|
|
98
|
+
"""Override several methods of cdt.Structure. It limited Structure."""
|
|
99
|
+
certificate_identification_type: CertificateIdentificationType
|
|
100
|
+
certification_identification_options: certification_identification_option
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class SecuritySetup(ver0.SecuritySetup):
|
|
104
|
+
VERSION = 1
|
|
105
|
+
A_ELEMENTS = (ICAElement(1, "security_policy", SecurityPolicy),
|
|
106
|
+
ICAElement(2, "security_suite", SecuritySuite),
|
|
107
|
+
ver0.SecuritySetup.getAElement(3).unwrap(),
|
|
108
|
+
ver0.SecuritySetup.getAElement(4).unwrap(),
|
|
109
|
+
ver0.SecuritySetup.getAElement(5).unwrap(),
|
|
110
|
+
ICAElement(6, "certificates", Certificates, classifier=Classifier.DYNAMIC))
|
|
111
|
+
|
|
112
|
+
M_ELEMENTS = (ICMElement(1, "security_activate", SecurityPolicy),
|
|
113
|
+
ICMElement(2, "key_transfer", KeyTransfer),
|
|
114
|
+
ICMElement(3, "key_agreement", KeyAgreement),
|
|
115
|
+
ICMElement(4, "generate_key_pair", KeyPair),
|
|
116
|
+
ICMElement(5, "generate_certificate_request", KeyPair),
|
|
117
|
+
ICMElement(6, "import_certificate", cdt.OctetString),
|
|
118
|
+
ICMElement(7, "export_certificate", CertificateIdentification),
|
|
119
|
+
ICMElement(8, "remove_certificate", CertificateIdentification))
|
|
120
|
+
security_policy: Optional[SecurityPolicy]
|
|
121
|
+
security_suite: Optional[SecuritySuite]
|
|
122
|
+
certificates: Optional[Certificates]
|
|
@@ -1,50 +1,34 @@
|
|
|
1
|
-
from .
|
|
2
|
-
from ..types
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
time
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def executed_script(self) -> structs.ActionItem:
|
|
36
|
-
return self.get_attr(2)
|
|
37
|
-
|
|
38
|
-
@property
|
|
39
|
-
def type_(self) -> TYPE:
|
|
40
|
-
return self.get_attr(3)
|
|
41
|
-
|
|
42
|
-
@property
|
|
43
|
-
def execution_time(self) -> ExecutionTime:
|
|
44
|
-
return self.get_attr(4)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if __name__ == '__main__':
|
|
48
|
-
a = ExecutionTimeDate(b'\x02\x02\t\x04\x12\x007\x00\t\x05\x07\xe5\x05\x1f\x01')
|
|
49
|
-
a = SingleActionSchedule('0.0.15.0.0.255')
|
|
50
|
-
print(a)
|
|
1
|
+
from ..types.implementations import structs
|
|
2
|
+
from ..types import cdt, cst
|
|
3
|
+
from ..types.type_alias import Attr
|
|
4
|
+
from .cosem_interface_class import ICAuto, ICAElement
|
|
5
|
+
from .Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TYPE(cdt.Enum, elements=(1, 2, 3, 4, 5)):
|
|
9
|
+
""""""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ExecutionTimeDate(cdt.Structure):
|
|
13
|
+
""" Specifies the time and teh date when the script is executed. The two octet-string s contain time and date, in this order; time and date are
|
|
14
|
+
formatted as specified in DLMS UA 1000-1 Ed.12.0 4.1.6.1. Hundredths of second shall be zero. """
|
|
15
|
+
time: cst.OctetStringTime
|
|
16
|
+
date: cst.OctetStringDate
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ExecutionTime(cdt.Array):
|
|
20
|
+
""" Specifies the list of execution time and date """
|
|
21
|
+
TYPE = ExecutionTimeDate
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SingleActionSchedule(ICAuto):
|
|
25
|
+
""" This IC allows modelling the execution of periodic actions within a meter. Such actions are not necessarily linked to tariffication
|
|
26
|
+
(see “Activity calendar” or “Schedule”). """
|
|
27
|
+
CLASS_ID = class_id.SINGLE_ACTION_SCHEDULE
|
|
28
|
+
VERSION = 0
|
|
29
|
+
A_ELEMENTS = (ICAElement(2, "executed_script", structs.ActionItem),
|
|
30
|
+
ICAElement(3, "type", TYPE),
|
|
31
|
+
ICAElement(4, "execution_time", ExecutionTime))
|
|
32
|
+
executed_script: Attr
|
|
33
|
+
type_: Attr
|
|
34
|
+
execution_time: Attr
|
|
@@ -1,84 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
self._cbs_attr_post_init.update({2: self.__set_delete})
|
|
56
|
-
self.set_attr(2, None)
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
def entries(self) -> Entries:
|
|
60
|
-
return self.get_attr(2)
|
|
61
|
-
|
|
62
|
-
@property
|
|
63
|
-
def insert(self) -> SpecDayEntry:
|
|
64
|
-
return self.get_meth(1)
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def delete(self) -> cdt.LongUnsigned:
|
|
68
|
-
return self.get_meth(2)
|
|
69
|
-
|
|
70
|
-
def __set_delete(self):
|
|
71
|
-
try:
|
|
72
|
-
self.delete.register_cb_preset(self.entries.validate_exist_index)
|
|
73
|
-
self.insert.index.register_cb_preset(self.entries.validate_exist_index)
|
|
74
|
-
except KeyError: # At init time
|
|
75
|
-
print('set delete NO:')
|
|
76
|
-
|
|
77
|
-
def __delete_entry(self):
|
|
78
|
-
"""remove one entry by according delete method index. Call after execute"""
|
|
79
|
-
for entry in self.entries.values:
|
|
80
|
-
if entry.index == self.delete:
|
|
81
|
-
self.entries.values.remove(entry)
|
|
82
|
-
return
|
|
83
|
-
else:
|
|
84
|
-
raise ValueError(F'not found entry with index {self.delete} for remove')
|
|
1
|
+
from ..types import cdt, cst
|
|
2
|
+
from ..types.type_alias import Attr
|
|
3
|
+
from .cosem_interface_class import ICAuto, ICAElement, ICMElement
|
|
4
|
+
from .Overview import class_id
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SpecDayEntry(cdt.Structure):
|
|
8
|
+
""" Specifies a special day identifier for a given date. The date may have wildcards for repeating special days like Christmas. """
|
|
9
|
+
index: cdt.LongUnsigned
|
|
10
|
+
specialday_date: cst.OctetStringDate
|
|
11
|
+
day_id: cdt.Unsigned
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Entries(cdt.Array):
|
|
15
|
+
""" Specifies the list of spec_day_entry """
|
|
16
|
+
TYPE = SpecDayEntry
|
|
17
|
+
values: list[SpecDayEntry]
|
|
18
|
+
__getitem__: SpecDayEntry
|
|
19
|
+
|
|
20
|
+
def new_element(self) -> SpecDayEntry:
|
|
21
|
+
indexes: list[int] = [int(el.index) for el in self.values]
|
|
22
|
+
for i in range(0x1_00_00):
|
|
23
|
+
if i not in indexes:
|
|
24
|
+
return SpecDayEntry((i, None, None)) # TODO: insert first DayID from ActiveCalendar as 3 element
|
|
25
|
+
raise ValueError(F'in {self} all indexes is busy')
|
|
26
|
+
|
|
27
|
+
def __check_index(self, value):
|
|
28
|
+
"""validate day_id from DayProfile"""
|
|
29
|
+
if cdt.LongUnsigned(value) in (entry.index for entry in self.values):
|
|
30
|
+
raise ValueError(F'{cdt.LongUnsigned(value)} already exist in {self}')
|
|
31
|
+
else:
|
|
32
|
+
"""validate OK"""
|
|
33
|
+
|
|
34
|
+
def validate_exist_index(self, value):
|
|
35
|
+
"""pass if value in indexes"""
|
|
36
|
+
if cdt.LongUnsigned(value) not in (entry.index for entry in self.values):
|
|
37
|
+
raise ValueError(F'{cdt.LongUnsigned(value)} not exist in {self}')
|
|
38
|
+
else:
|
|
39
|
+
"""validate OK"""
|
|
40
|
+
|
|
41
|
+
def get_indexes(self) -> list[int]:
|
|
42
|
+
""" getter for callback Index """
|
|
43
|
+
return [int(entries_element.index) for entries_element in self.values]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SpecialDaysTable(ICAuto):
|
|
47
|
+
""" The interface class allows defining dates, which will override normal switching behaviour for special days. The interface class works in
|
|
48
|
+
conjunction with the class "Schedule" or "Activity calendar" and the linking data item is day_id """
|
|
49
|
+
CLASS_ID = class_id.SPECIAL_DAYS_TABLE
|
|
50
|
+
VERSION = 0
|
|
51
|
+
A_ELEMENTS = ICAElement(2, "entries", Entries),
|
|
52
|
+
M_ELEMENTS = (ICMElement(1, "insert", SpecDayEntry),
|
|
53
|
+
ICMElement(2, "delete", cdt.LongUnsigned)) # Todo: was Delete.with_cb(None, self.entries.get_indexes)
|
|
54
|
+
entries: Attr
|