DLMS-SPODES 0.87.12__py3-none-any.whl → 0.87.15__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/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +20 -20
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +254 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +105 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +34 -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 +485 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +133 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +36 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +4 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +12 -12
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +12 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +131 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2122 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +583 -583
- DLMS_SPODES/cosem_interface_classes/data.py +21 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +59 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +74 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +27 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +43 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +103 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +40 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +9 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +53 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +11 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +126 -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 +487 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +83 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +72 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +111 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +333 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +65 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +39 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +67 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +23 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +197 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +547 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +122 -122
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +277 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +12 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +10 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +166 -166
- DLMS_SPODES/cosem_interface_classes/register.py +45 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +80 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +46 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +70 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +176 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +87 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +68 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +158 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +50 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +84 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +42 -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 +465 -463
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +142 -142
- DLMS_SPODES/types/common_data_types.py +2401 -2399
- 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 +11 -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/useful_types.py +677 -677
- {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/METADATA +30 -30
- dlms_spodes-0.87.15.dist-info/RECORD +117 -0
- {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/WHEEL +1 -1
- dlms_spodes-0.87.12.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/top_level.txt +0 -0
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
from ..__class_init__ import *
|
|
2
|
-
from ...types.implementations.enums import CommSpeed
|
|
3
|
-
from ..overview import VERSION_0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class InitializationStringElement(cdt.Structure):
|
|
7
|
-
""" Request - Response strings"""
|
|
8
|
-
request: cdt.OctetString
|
|
9
|
-
response: cdt.OctetString
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class InitializationString(cdt.Array):
|
|
13
|
-
""" This data contains all the necessary initialization commands to be sent to the modem in order to configure it properly. This may include the configuration of special
|
|
14
|
-
modem features.
|
|
15
|
-
If the array contains more than one initialization string element, they are subsequently sent to the modem after receiving an answer matching the defined response.
|
|
16
|
-
It is assumed that the modem is pre-configured so that it accepts the initialization_string . If no initialization is needed, the initialization string is empty."""
|
|
17
|
-
TYPE=InitializationStringElement
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ModemProfileElement(cdt.OctetString):
|
|
21
|
-
""" TODO: can be OK, CONNECT, RING, NO CARRIER, ERROR, CONNECT 1 200, NO DIAL TONE, BUSY, NO ANSWER, CONNECT 600, CONNECT 2 400, CONNECT 4 800, CONNECT 9 600, CONNECT 14 400,
|
|
22
|
-
CONNECT 28 800, CONNECT 36 600, CONNECT 56 000"""
|
|
23
|
-
|
|
24
|
-
def __init__(self, value: bytes = b'OK'.hex()):
|
|
25
|
-
super(ModemProfileElement, self).__init__(value)
|
|
26
|
-
if bytes(self) not in self.get_validate_values(): # todo: make ReportMixin
|
|
27
|
-
raise ValueError(F'Got modem profile element {bytes(self)}, expected {b", ".join(self.get_validate_values())}')
|
|
28
|
-
else:
|
|
29
|
-
pass
|
|
30
|
-
|
|
31
|
-
@staticmethod
|
|
32
|
-
def get_validate_values() -> tuple[bytes, ...]:
|
|
33
|
-
return b'OK', b'CONNECT', b'RING', b'NO CARRIER', b'ERROR', b'CONNECT 1 200', b'NO DIAL TONE', b'BUSY', b'NO ANSWER', b'CONNECT 600', b'CONNECT 2 400', b'CONNECT 4 800', \
|
|
34
|
-
b'CONNECT 9 600', b'CONNECT 14 400', b'CONNECT 28 800', b'CONNECT 36 600', b'CONNECT 56 000'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ModemProfile(cdt.Array):
|
|
38
|
-
""" This data defines the mapping from Hayes standard commands/responses to modem specific strings. Shall contain the corresponding stings for the modem used in following
|
|
39
|
-
order"""
|
|
40
|
-
TYPE = ModemProfileElement
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class PSTNModemConfiguration(ic.COSEMInterfaceClasses):
|
|
44
|
-
""" An instance of the 'PSTN modem configuration' IC stores data related to the initialization of modems, which are used for data transfer from/to a device. Several modems
|
|
45
|
-
can be configured."""
|
|
46
|
-
CLASS_ID = ClassID.MODEM_CONFIGURATION
|
|
47
|
-
VERSION = VERSION_0
|
|
48
|
-
A_ELEMENTS = (ic.ICAElement("comm_speed", CommSpeed, 0, 9, 5),
|
|
49
|
-
ic.ICAElement("initialization_string", InitializationString),
|
|
50
|
-
ic.ICAElement("modem_profile", ModemProfile))
|
|
51
|
-
|
|
52
|
-
def characteristics_init(self):
|
|
53
|
-
"""nothing do it"""
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
def comm_speed(self) -> CommSpeed:
|
|
57
|
-
return self.get_attr(2)
|
|
58
|
-
|
|
59
|
-
@property
|
|
60
|
-
def initialization_string(self) -> InitializationString:
|
|
61
|
-
return self.get_attr(3)
|
|
62
|
-
|
|
63
|
-
@property
|
|
64
|
-
def modem_profile(self) -> ModemProfile:
|
|
65
|
-
return self.get_attr(4)
|
|
1
|
+
from ..__class_init__ import *
|
|
2
|
+
from ...types.implementations.enums import CommSpeed
|
|
3
|
+
from ..overview import VERSION_0
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InitializationStringElement(cdt.Structure):
|
|
7
|
+
""" Request - Response strings"""
|
|
8
|
+
request: cdt.OctetString
|
|
9
|
+
response: cdt.OctetString
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InitializationString(cdt.Array):
|
|
13
|
+
""" This data contains all the necessary initialization commands to be sent to the modem in order to configure it properly. This may include the configuration of special
|
|
14
|
+
modem features.
|
|
15
|
+
If the array contains more than one initialization string element, they are subsequently sent to the modem after receiving an answer matching the defined response.
|
|
16
|
+
It is assumed that the modem is pre-configured so that it accepts the initialization_string . If no initialization is needed, the initialization string is empty."""
|
|
17
|
+
TYPE=InitializationStringElement
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ModemProfileElement(cdt.OctetString):
|
|
21
|
+
""" TODO: can be OK, CONNECT, RING, NO CARRIER, ERROR, CONNECT 1 200, NO DIAL TONE, BUSY, NO ANSWER, CONNECT 600, CONNECT 2 400, CONNECT 4 800, CONNECT 9 600, CONNECT 14 400,
|
|
22
|
+
CONNECT 28 800, CONNECT 36 600, CONNECT 56 000"""
|
|
23
|
+
|
|
24
|
+
def __init__(self, value: bytes = b'OK'.hex()):
|
|
25
|
+
super(ModemProfileElement, self).__init__(value)
|
|
26
|
+
if bytes(self) not in self.get_validate_values(): # todo: make ReportMixin
|
|
27
|
+
raise ValueError(F'Got modem profile element {bytes(self)}, expected {b", ".join(self.get_validate_values())}')
|
|
28
|
+
else:
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def get_validate_values() -> tuple[bytes, ...]:
|
|
33
|
+
return b'OK', b'CONNECT', b'RING', b'NO CARRIER', b'ERROR', b'CONNECT 1 200', b'NO DIAL TONE', b'BUSY', b'NO ANSWER', b'CONNECT 600', b'CONNECT 2 400', b'CONNECT 4 800', \
|
|
34
|
+
b'CONNECT 9 600', b'CONNECT 14 400', b'CONNECT 28 800', b'CONNECT 36 600', b'CONNECT 56 000'
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ModemProfile(cdt.Array):
|
|
38
|
+
""" This data defines the mapping from Hayes standard commands/responses to modem specific strings. Shall contain the corresponding stings for the modem used in following
|
|
39
|
+
order"""
|
|
40
|
+
TYPE = ModemProfileElement
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class PSTNModemConfiguration(ic.COSEMInterfaceClasses):
|
|
44
|
+
""" An instance of the 'PSTN modem configuration' IC stores data related to the initialization of modems, which are used for data transfer from/to a device. Several modems
|
|
45
|
+
can be configured."""
|
|
46
|
+
CLASS_ID = ClassID.MODEM_CONFIGURATION
|
|
47
|
+
VERSION = VERSION_0
|
|
48
|
+
A_ELEMENTS = (ic.ICAElement("comm_speed", CommSpeed, 0, 9, 5),
|
|
49
|
+
ic.ICAElement("initialization_string", InitializationString),
|
|
50
|
+
ic.ICAElement("modem_profile", ModemProfile))
|
|
51
|
+
|
|
52
|
+
def characteristics_init(self):
|
|
53
|
+
"""nothing do it"""
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def comm_speed(self) -> CommSpeed:
|
|
57
|
+
return self.get_attr(2)
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def initialization_string(self) -> InitializationString:
|
|
61
|
+
return self.get_attr(3)
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def modem_profile(self) -> ModemProfile:
|
|
65
|
+
return self.get_attr(4)
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
from ..__class_init__ import *
|
|
2
|
-
from . import ver0
|
|
3
|
-
from ..overview import VERSION_1
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class InitializationStringElement(cdt.Structure):
|
|
7
|
-
""" Request - Response strings"""
|
|
8
|
-
request: cdt.OctetString
|
|
9
|
-
response: cdt.OctetString
|
|
10
|
-
delay_after_response: cdt.LongUnsigned
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class InitializationString(cdt.Array):
|
|
14
|
-
""" Contains all the necessary initialization commands to be sent to the modem in order to configure it properly. This may include the configuration of special modem
|
|
15
|
-
features. If the array contains more than one initialization_string_element, the requests are set in a sequence.The next request is sent after the expected response matching
|
|
16
|
-
the previous request and waiting a delay-after-response time [ms], to allow the modem toe execute teh request.
|
|
17
|
-
It is assumed that the modem is per-configured so that it accepts the initialization-string. If no initialization is needed, the initialization string is empty. """
|
|
18
|
-
TYPE = InitializationStringElement
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ModemConfigurationVer1(ic.COSEMInterfaceClasses):
|
|
22
|
-
""" This IC allow modelling the configuration and initialisation of modems used for data transfer from/to a device. Several modems can be configured."""
|
|
23
|
-
ClassID = ut.CosemClassId(27)
|
|
24
|
-
VERSION = VERSION_1
|
|
25
|
-
A_ELEMENTS = (ver0.PSTNModemConfiguration.get_attr_element(2),
|
|
26
|
-
ic.ICAElement("initialization_string", InitializationString),
|
|
27
|
-
ver0.PSTNModemConfiguration.get_attr_element(4))
|
|
28
|
-
|
|
29
|
-
def characteristics_init(self):
|
|
30
|
-
"""nothing do it"""
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def initialization_string(self) -> InitializationString:
|
|
34
|
-
return self.get_attr(3)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if __name__ == '__main__':
|
|
38
|
-
a = ModemConfigurationVer1('0.0.2.0.0.255')
|
|
39
|
-
print(a)
|
|
1
|
+
from ..__class_init__ import *
|
|
2
|
+
from . import ver0
|
|
3
|
+
from ..overview import VERSION_1
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InitializationStringElement(cdt.Structure):
|
|
7
|
+
""" Request - Response strings"""
|
|
8
|
+
request: cdt.OctetString
|
|
9
|
+
response: cdt.OctetString
|
|
10
|
+
delay_after_response: cdt.LongUnsigned
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class InitializationString(cdt.Array):
|
|
14
|
+
""" Contains all the necessary initialization commands to be sent to the modem in order to configure it properly. This may include the configuration of special modem
|
|
15
|
+
features. If the array contains more than one initialization_string_element, the requests are set in a sequence.The next request is sent after the expected response matching
|
|
16
|
+
the previous request and waiting a delay-after-response time [ms], to allow the modem toe execute teh request.
|
|
17
|
+
It is assumed that the modem is per-configured so that it accepts the initialization-string. If no initialization is needed, the initialization string is empty. """
|
|
18
|
+
TYPE = InitializationStringElement
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ModemConfigurationVer1(ic.COSEMInterfaceClasses):
|
|
22
|
+
""" This IC allow modelling the configuration and initialisation of modems used for data transfer from/to a device. Several modems can be configured."""
|
|
23
|
+
ClassID = ut.CosemClassId(27)
|
|
24
|
+
VERSION = VERSION_1
|
|
25
|
+
A_ELEMENTS = (ver0.PSTNModemConfiguration.get_attr_element(2),
|
|
26
|
+
ic.ICAElement("initialization_string", InitializationString),
|
|
27
|
+
ver0.PSTNModemConfiguration.get_attr_element(4))
|
|
28
|
+
|
|
29
|
+
def characteristics_init(self):
|
|
30
|
+
"""nothing do it"""
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def initialization_string(self) -> InitializationString:
|
|
34
|
+
return self.get_attr(3)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if __name__ == '__main__':
|
|
38
|
+
a = ModemConfigurationVer1('0.0.2.0.0.255')
|
|
39
|
+
print(a)
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
from ..__class_init__ import *
|
|
2
|
-
from ...types.implementations import integers
|
|
3
|
-
from ..overview import VERSION_0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ServerAddress(cdt.OctetString):
|
|
7
|
-
""""""
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class AuthenticationMethod(cdt.Enum, elements=(0, 1, 2)):
|
|
11
|
-
"""Defines the authentication mode used for NTP protocol"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class AuthenticationKey(cdt.Structure):
|
|
15
|
-
""""""
|
|
16
|
-
key_id: cdt.DoubleLongUnsigned
|
|
17
|
-
key: cdt.OctetString
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class AuthenticationKeys(cdt.Array):
|
|
21
|
-
"""Contains the necessary symmetric keys if shared secrets mode of authentication is used"""
|
|
22
|
-
TYPE = AuthenticationKey
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class NTPSetup(ic.COSEMInterfaceClasses):
|
|
26
|
-
"""DLMS UA 1000-1 Ed 14, 4.9.7 NTP setup"""
|
|
27
|
-
CLASS_ID = ClassID.NTP_SETUP
|
|
28
|
-
VERSION = VERSION_0
|
|
29
|
-
A_ELEMENTS = (
|
|
30
|
-
ic.ICAElement("activated", cdt.Boolean, default=False),
|
|
31
|
-
ic.ICAElement("server_address", ServerAddress),
|
|
32
|
-
ic.ICAElement("server_port", cdt.LongUnsigned, default=123),
|
|
33
|
-
ic.ICAElement("authentication_method", AuthenticationMethod),
|
|
34
|
-
ic.ICAElement("authentication_keys", AuthenticationKeys),
|
|
35
|
-
ic.ICAElement("client_key", cdt.OctetString))
|
|
36
|
-
M_ELEMENTS = (
|
|
37
|
-
ic.ICMElement("synchronize", integers.Only0),
|
|
38
|
-
ic.ICMElement("add_authentication_key", AuthenticationKey),
|
|
39
|
-
ic.ICMElement("delete_authentication_key", cdt.DoubleLongUnsigned),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
def characteristics_init(self):
|
|
43
|
-
"""nothing do it"""
|
|
44
|
-
|
|
45
|
-
@property
|
|
46
|
-
def activated(self) -> cdt.Boolean:
|
|
47
|
-
return self.get_attr(2)
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def server_address(self) -> ServerAddress:
|
|
51
|
-
return self.get_attr(3)
|
|
52
|
-
|
|
53
|
-
@property
|
|
54
|
-
def server_port(self) -> cdt.LongUnsigned:
|
|
55
|
-
return self.get_attr(4)
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def authentication_method(self) -> AuthenticationMethod:
|
|
59
|
-
return self.get_attr(5)
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def authentication_keys(self) -> AuthenticationKeys:
|
|
63
|
-
return self.get_attr(6)
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def client_key(self) -> cdt.OctetString:
|
|
67
|
-
return self.get_attr(7)
|
|
1
|
+
from ..__class_init__ import *
|
|
2
|
+
from ...types.implementations import integers
|
|
3
|
+
from ..overview import VERSION_0
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ServerAddress(cdt.OctetString):
|
|
7
|
+
""""""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AuthenticationMethod(cdt.Enum, elements=(0, 1, 2)):
|
|
11
|
+
"""Defines the authentication mode used for NTP protocol"""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AuthenticationKey(cdt.Structure):
|
|
15
|
+
""""""
|
|
16
|
+
key_id: cdt.DoubleLongUnsigned
|
|
17
|
+
key: cdt.OctetString
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AuthenticationKeys(cdt.Array):
|
|
21
|
+
"""Contains the necessary symmetric keys if shared secrets mode of authentication is used"""
|
|
22
|
+
TYPE = AuthenticationKey
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class NTPSetup(ic.COSEMInterfaceClasses):
|
|
26
|
+
"""DLMS UA 1000-1 Ed 14, 4.9.7 NTP setup"""
|
|
27
|
+
CLASS_ID = ClassID.NTP_SETUP
|
|
28
|
+
VERSION = VERSION_0
|
|
29
|
+
A_ELEMENTS = (
|
|
30
|
+
ic.ICAElement("activated", cdt.Boolean, default=False),
|
|
31
|
+
ic.ICAElement("server_address", ServerAddress),
|
|
32
|
+
ic.ICAElement("server_port", cdt.LongUnsigned, default=123),
|
|
33
|
+
ic.ICAElement("authentication_method", AuthenticationMethod),
|
|
34
|
+
ic.ICAElement("authentication_keys", AuthenticationKeys),
|
|
35
|
+
ic.ICAElement("client_key", cdt.OctetString))
|
|
36
|
+
M_ELEMENTS = (
|
|
37
|
+
ic.ICMElement("synchronize", integers.Only0),
|
|
38
|
+
ic.ICMElement("add_authentication_key", AuthenticationKey),
|
|
39
|
+
ic.ICMElement("delete_authentication_key", cdt.DoubleLongUnsigned),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def characteristics_init(self):
|
|
43
|
+
"""nothing do it"""
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def activated(self) -> cdt.Boolean:
|
|
47
|
+
return self.get_attr(2)
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def server_address(self) -> ServerAddress:
|
|
51
|
+
return self.get_attr(3)
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def server_port(self) -> cdt.LongUnsigned:
|
|
55
|
+
return self.get_attr(4)
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def authentication_method(self) -> AuthenticationMethod:
|
|
59
|
+
return self.get_attr(5)
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def authentication_keys(self) -> AuthenticationKeys:
|
|
63
|
+
return self.get_attr(6)
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def client_key(self) -> cdt.OctetString:
|
|
67
|
+
return self.get_attr(7)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
class OBIS(bytes):
|
|
2
|
-
"""bytes[6]"""
|
|
3
|
-
|
|
4
|
-
def validate(self):
|
|
5
|
-
if (length := len(self)) != 6:
|
|
6
|
-
return ValueError(f"got {length=}, expected 6")
|
|
7
|
-
|
|
8
|
-
def __str__(self):
|
|
9
|
-
return F"{".".join(map(str, self[:6]))}"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class AssociationLN(OBIS):
|
|
13
|
-
def __new__(cls, e: int):
|
|
14
|
-
return super().__new__(cls, (0, 0, 40, 0, e, 255))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
CURRENT_ASSOCIATION = OBIS((0, 0, 40, 0, 0, 255))
|
|
18
|
-
PUBLIC_ASSOCIATION = OBIS((0, 0, 40, 0, 1, 255))
|
|
19
|
-
LDN = OBIS((0, 0, 42, 0, 0, 255))
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# SPODES_3
|
|
23
|
-
SPODES3_DISPLAY_MODE = OBIS((0, 0, 96, 4, 1, 255))
|
|
1
|
+
class OBIS(bytes):
|
|
2
|
+
"""bytes[6]"""
|
|
3
|
+
|
|
4
|
+
def validate(self):
|
|
5
|
+
if (length := len(self)) != 6:
|
|
6
|
+
return ValueError(f"got {length=}, expected 6")
|
|
7
|
+
|
|
8
|
+
def __str__(self):
|
|
9
|
+
return F"{".".join(map(str, self[:6]))}"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AssociationLN(OBIS):
|
|
13
|
+
def __new__(cls, e: int):
|
|
14
|
+
return super().__new__(cls, (0, 0, 40, 0, e, 255))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
CURRENT_ASSOCIATION = OBIS((0, 0, 40, 0, 0, 255))
|
|
18
|
+
PUBLIC_ASSOCIATION = OBIS((0, 0, 40, 0, 1, 255))
|
|
19
|
+
LDN = OBIS((0, 0, 42, 0, 0, 255))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# SPODES_3
|
|
23
|
+
SPODES3_DISPLAY_MODE = OBIS((0, 0, 96, 4, 1, 255))
|