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,21 +1,21 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from ..types import choices
|
|
3
|
-
from . import cosem_interface_class as ic
|
|
4
|
-
from .overview import ClassID
|
|
5
|
-
from .overview import VERSION_0
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Data(ic.COSEMInterfaceClasses):
|
|
9
|
-
""" Object stores data related to internal meter object(s). The meaning of the value is identified by the logical_name.
|
|
10
|
-
The data type of the value is CHOICE. “Data” is typically used to store configuration data and parameters """
|
|
11
|
-
CLASS_ID = ClassID.DATA
|
|
12
|
-
VERSION = VERSION_0
|
|
13
|
-
A_ELEMENTS = ic.ICAElement("value", choices.common_dt, classifier=ic.Classifier.NOT_SPECIFIC),
|
|
14
|
-
|
|
15
|
-
def characteristics_init(self):
|
|
16
|
-
"""nothing do it"""
|
|
17
|
-
|
|
18
|
-
@property
|
|
19
|
-
def value(self) -> cdt.CommonDataTypes:
|
|
20
|
-
"""Contains the data"""
|
|
21
|
-
return self.get_attr(2)
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from ..types import choices
|
|
3
|
+
from . import cosem_interface_class as ic
|
|
4
|
+
from .overview import ClassID
|
|
5
|
+
from .overview import VERSION_0
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Data(ic.COSEMInterfaceClasses):
|
|
9
|
+
""" Object stores data related to internal meter object(s). The meaning of the value is identified by the logical_name.
|
|
10
|
+
The data type of the value is CHOICE. “Data” is typically used to store configuration data and parameters """
|
|
11
|
+
CLASS_ID = ClassID.DATA
|
|
12
|
+
VERSION = VERSION_0
|
|
13
|
+
A_ELEMENTS = ic.ICAElement("value", choices.common_dt, classifier=ic.Classifier.NOT_SPECIFIC),
|
|
14
|
+
|
|
15
|
+
def characteristics_init(self):
|
|
16
|
+
"""nothing do it"""
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def value(self) -> cdt.CommonDataTypes:
|
|
20
|
+
"""Contains the data"""
|
|
21
|
+
return self.get_attr(2)
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
from ..__class_init__ import *
|
|
2
|
-
from ...types import choices
|
|
3
|
-
from ...types.implementations import integers
|
|
4
|
-
from ..overview import VERSION_0
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class DemandRegister(ic.COSEMInterfaceClasses):
|
|
8
|
-
"""DLMS UA 1000-1 Ed 14 4.3.4.Demand register"""
|
|
9
|
-
CLASS_ID = ClassID.DEMAND_REGISTER
|
|
10
|
-
VERSION = VERSION_0
|
|
11
|
-
A_ELEMENTS = (
|
|
12
|
-
ic.ICAElement("current_average_value", choices.register, classifier=ic.Classifier.DYNAMIC),
|
|
13
|
-
ic.ICAElement("last_average_value", choices.register, classifier=ic.Classifier.DYNAMIC),
|
|
14
|
-
ic.ICAElement("scaler_unit", cdt.ScalUnitType),
|
|
15
|
-
ic.ICAElement("status", choices.extended_register, classifier=ic.Classifier.DYNAMIC),
|
|
16
|
-
ic.ICAElement("capture_time", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC),
|
|
17
|
-
ic.ICAElement("start_time_current", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC),
|
|
18
|
-
ic.ICAElement("period", cdt.DoubleLongUnsigned, min=1),
|
|
19
|
-
ic.ICAElement("number_of_periods", cdt.LongUnsigned, min=1, default=1))
|
|
20
|
-
M_ELEMENTS = (
|
|
21
|
-
ic.ICMElement("reset", integers.Only0),
|
|
22
|
-
ic.ICMElement("next_period", integers.Only0))
|
|
23
|
-
scaler_unit_not_settable: bool
|
|
24
|
-
|
|
25
|
-
@property
|
|
26
|
-
def current_average_value(self) -> choices.RegisterValues:
|
|
27
|
-
return self.get_attr(2)
|
|
28
|
-
|
|
29
|
-
@property
|
|
30
|
-
def last_average_value(self) -> choices.RegisterValues:
|
|
31
|
-
return self.get_attr(3)
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def scaler_unit(self) -> cdt.ScalUnitType:
|
|
35
|
-
return self.get_attr(4)
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def status(self) -> choices.ExtendedRegisterValues:
|
|
39
|
-
return self.get_attr(5)
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def capture_time(self) -> cst.OctetStringDateTime:
|
|
43
|
-
return self.get_attr(6)
|
|
44
|
-
|
|
45
|
-
@property
|
|
46
|
-
def start_time_current(self) -> cst.OctetStringDateTime:
|
|
47
|
-
return self.get_attr(7)
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def period(self) -> cdt.DoubleLongUnsigned:
|
|
51
|
-
return self.get_attr(8)
|
|
52
|
-
|
|
53
|
-
@property
|
|
54
|
-
def number_of_periods(self) -> cdt.LongUnsigned:
|
|
55
|
-
return self.get_attr(9)
|
|
56
|
-
|
|
57
|
-
def characteristics_init(self):
|
|
58
|
-
self.scaler_unit_not_settable = False
|
|
59
|
-
""" usability scaler unit flag. if True then it not used"""
|
|
1
|
+
from ..__class_init__ import *
|
|
2
|
+
from ...types import choices
|
|
3
|
+
from ...types.implementations import integers
|
|
4
|
+
from ..overview import VERSION_0
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DemandRegister(ic.COSEMInterfaceClasses):
|
|
8
|
+
"""DLMS UA 1000-1 Ed 14 4.3.4.Demand register"""
|
|
9
|
+
CLASS_ID = ClassID.DEMAND_REGISTER
|
|
10
|
+
VERSION = VERSION_0
|
|
11
|
+
A_ELEMENTS = (
|
|
12
|
+
ic.ICAElement("current_average_value", choices.register, classifier=ic.Classifier.DYNAMIC),
|
|
13
|
+
ic.ICAElement("last_average_value", choices.register, classifier=ic.Classifier.DYNAMIC),
|
|
14
|
+
ic.ICAElement("scaler_unit", cdt.ScalUnitType),
|
|
15
|
+
ic.ICAElement("status", choices.extended_register, classifier=ic.Classifier.DYNAMIC),
|
|
16
|
+
ic.ICAElement("capture_time", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC),
|
|
17
|
+
ic.ICAElement("start_time_current", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC),
|
|
18
|
+
ic.ICAElement("period", cdt.DoubleLongUnsigned, min=1),
|
|
19
|
+
ic.ICAElement("number_of_periods", cdt.LongUnsigned, min=1, default=1))
|
|
20
|
+
M_ELEMENTS = (
|
|
21
|
+
ic.ICMElement("reset", integers.Only0),
|
|
22
|
+
ic.ICMElement("next_period", integers.Only0))
|
|
23
|
+
scaler_unit_not_settable: bool
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def current_average_value(self) -> choices.RegisterValues:
|
|
27
|
+
return self.get_attr(2)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def last_average_value(self) -> choices.RegisterValues:
|
|
31
|
+
return self.get_attr(3)
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def scaler_unit(self) -> cdt.ScalUnitType:
|
|
35
|
+
return self.get_attr(4)
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def status(self) -> choices.ExtendedRegisterValues:
|
|
39
|
+
return self.get_attr(5)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def capture_time(self) -> cst.OctetStringDateTime:
|
|
43
|
+
return self.get_attr(6)
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def start_time_current(self) -> cst.OctetStringDateTime:
|
|
47
|
+
return self.get_attr(7)
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def period(self) -> cdt.DoubleLongUnsigned:
|
|
51
|
+
return self.get_attr(8)
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def number_of_periods(self) -> cdt.LongUnsigned:
|
|
55
|
+
return self.get_attr(9)
|
|
56
|
+
|
|
57
|
+
def characteristics_init(self):
|
|
58
|
+
self.scaler_unit_not_settable = False
|
|
59
|
+
""" usability scaler unit flag. if True then it not used"""
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
from .__class_init__ import *
|
|
2
|
-
from ..types.implementations import integers
|
|
3
|
-
from itertools import chain
|
|
4
|
-
from ..config_parser import get_message
|
|
5
|
-
from .overview import VERSION_0
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ControlState(cdt.Enum, elements=(0, 1, 2)):
|
|
9
|
-
""" Shows the internal state of the disconnect control object. """
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ControlMode(cdt.Enum, elements=tuple(chain(range(7), range(129, 135)))):
|
|
13
|
-
""" Configures the behaviour of the disconnect control object for all triggers. Local disconnection is always possible.
|
|
14
|
-
To suppress local disconnection, the corresponding trigger must be inhibited. """
|
|
15
|
-
|
|
16
|
-
@staticmethod
|
|
17
|
-
def get_letters(value: int) -> str:
|
|
18
|
-
"""return transition litters"""
|
|
19
|
-
match value:
|
|
20
|
-
case 0: return ""
|
|
21
|
-
case 1: return "bcfgde"
|
|
22
|
-
case 2: return "bcfgae"
|
|
23
|
-
case 3: return "bcgde"
|
|
24
|
-
case 4: return "bcgae"
|
|
25
|
-
case 5: return "bcfgdeh"
|
|
26
|
-
case 6: return "bcgdeh"
|
|
27
|
-
case 129: return "bcfmde"
|
|
28
|
-
case 130: return "bcfmae"
|
|
29
|
-
case 131: return "bcmde"
|
|
30
|
-
case 132: return "bcma"
|
|
31
|
-
case 133: return "bcmak"
|
|
32
|
-
case 134: return "bcmsdep"
|
|
33
|
-
case _: raise ValueError(F"unknown {value=}")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class OutputState(cdt.Boolean):
|
|
37
|
-
""" Shows the actual physical state of the disconnect unit, i.e. if an electricity breaker or a gas valve is open or closed. TRUE = connected, FALSE = disconnected.
|
|
38
|
-
In electricity metering, the supply is connected when the disconnector device is closed. In gas and water metering, the supply is connected when the valve is open """
|
|
39
|
-
def __str__(self):
|
|
40
|
-
return get_message("$disconnected$") if self.contents == b'\x00' else get_message("$connected$")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class DisconnectControl(ic.COSEMInterfaceClasses):
|
|
44
|
-
"""DLMS UA 1000-1 Ed. 14 4.5.8 Disconnect control"""
|
|
45
|
-
CLASS_ID = ClassID.DISCONNECT_CONTROL
|
|
46
|
-
VERSION = VERSION_0
|
|
47
|
-
A_ELEMENTS = (ic.ICAElement("output_state", OutputState, classifier=ic.Classifier.DYNAMIC),
|
|
48
|
-
ic.ICAElement("control_state", ControlState, classifier=ic.Classifier.DYNAMIC),
|
|
49
|
-
ic.ICAElement("control_mode", ControlMode))
|
|
50
|
-
M_ELEMENTS = (ic.ICMElement("remote_disconnect", integers.Only0),
|
|
51
|
-
ic.ICMElement("remote_reconnect", integers.Only0))
|
|
52
|
-
|
|
53
|
-
def characteristics_init(self):
|
|
54
|
-
"""nothing do it"""
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def output_state(self) -> cdt.Boolean:
|
|
58
|
-
return self.get_attr(2)
|
|
59
|
-
|
|
60
|
-
@property
|
|
61
|
-
def control_state(self) -> ControlState:
|
|
62
|
-
return self.get_attr(3)
|
|
63
|
-
|
|
64
|
-
@property
|
|
65
|
-
def control_mode(self) -> ControlMode:
|
|
66
|
-
return self.get_attr(4)
|
|
67
|
-
|
|
68
|
-
@property
|
|
69
|
-
def remote_disconnect(self) -> cdt.Integer:
|
|
70
|
-
return self.get_meth(1)
|
|
71
|
-
|
|
72
|
-
@property
|
|
73
|
-
def remote_reconnect(self) -> cdt.Integer:
|
|
74
|
-
return self.get_meth(2)
|
|
1
|
+
from .__class_init__ import *
|
|
2
|
+
from ..types.implementations import integers
|
|
3
|
+
from itertools import chain
|
|
4
|
+
from ..config_parser import get_message
|
|
5
|
+
from .overview import VERSION_0
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ControlState(cdt.Enum, elements=(0, 1, 2)):
|
|
9
|
+
""" Shows the internal state of the disconnect control object. """
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ControlMode(cdt.Enum, elements=tuple(chain(range(7), range(129, 135)))):
|
|
13
|
+
""" Configures the behaviour of the disconnect control object for all triggers. Local disconnection is always possible.
|
|
14
|
+
To suppress local disconnection, the corresponding trigger must be inhibited. """
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def get_letters(value: int) -> str:
|
|
18
|
+
"""return transition litters"""
|
|
19
|
+
match value:
|
|
20
|
+
case 0: return ""
|
|
21
|
+
case 1: return "bcfgde"
|
|
22
|
+
case 2: return "bcfgae"
|
|
23
|
+
case 3: return "bcgde"
|
|
24
|
+
case 4: return "bcgae"
|
|
25
|
+
case 5: return "bcfgdeh"
|
|
26
|
+
case 6: return "bcgdeh"
|
|
27
|
+
case 129: return "bcfmde"
|
|
28
|
+
case 130: return "bcfmae"
|
|
29
|
+
case 131: return "bcmde"
|
|
30
|
+
case 132: return "bcma"
|
|
31
|
+
case 133: return "bcmak"
|
|
32
|
+
case 134: return "bcmsdep"
|
|
33
|
+
case _: raise ValueError(F"unknown {value=}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class OutputState(cdt.Boolean):
|
|
37
|
+
""" Shows the actual physical state of the disconnect unit, i.e. if an electricity breaker or a gas valve is open or closed. TRUE = connected, FALSE = disconnected.
|
|
38
|
+
In electricity metering, the supply is connected when the disconnector device is closed. In gas and water metering, the supply is connected when the valve is open """
|
|
39
|
+
def __str__(self):
|
|
40
|
+
return get_message("$disconnected$") if self.contents == b'\x00' else get_message("$connected$")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class DisconnectControl(ic.COSEMInterfaceClasses):
|
|
44
|
+
"""DLMS UA 1000-1 Ed. 14 4.5.8 Disconnect control"""
|
|
45
|
+
CLASS_ID = ClassID.DISCONNECT_CONTROL
|
|
46
|
+
VERSION = VERSION_0
|
|
47
|
+
A_ELEMENTS = (ic.ICAElement("output_state", OutputState, classifier=ic.Classifier.DYNAMIC),
|
|
48
|
+
ic.ICAElement("control_state", ControlState, classifier=ic.Classifier.DYNAMIC),
|
|
49
|
+
ic.ICAElement("control_mode", ControlMode))
|
|
50
|
+
M_ELEMENTS = (ic.ICMElement("remote_disconnect", integers.Only0),
|
|
51
|
+
ic.ICMElement("remote_reconnect", integers.Only0))
|
|
52
|
+
|
|
53
|
+
def characteristics_init(self):
|
|
54
|
+
"""nothing do it"""
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def output_state(self) -> cdt.Boolean:
|
|
58
|
+
return self.get_attr(2)
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def control_state(self) -> ControlState:
|
|
62
|
+
return self.get_attr(3)
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def control_mode(self) -> ControlMode:
|
|
66
|
+
return self.get_attr(4)
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def remote_disconnect(self) -> cdt.Integer:
|
|
70
|
+
return self.get_meth(1)
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def remote_reconnect(self) -> cdt.Integer:
|
|
74
|
+
return self.get_meth(2)
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
from . import register
|
|
2
|
-
from .__class_init__ import *
|
|
3
|
-
from ..types import choices
|
|
4
|
-
from .overview import VERSION_0
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ExtendedRegister(register.Register, ic.COSEMInterfaceClasses):
|
|
8
|
-
""" A “Register” object stores a process value or a status value with its associated unit. The register object knows
|
|
9
|
-
the nature of the process value or of the status value. The nature of the value is described by the attribute
|
|
10
|
-
“logical name” using the OBIS identification system. """
|
|
11
|
-
CLASS_ID = ClassID.EXT_REGISTER
|
|
12
|
-
VERSION = VERSION_0
|
|
13
|
-
A_ELEMENTS = (register.Register.get_attr_element(2),
|
|
14
|
-
register.Register.get_attr_element(3),
|
|
15
|
-
ic.ICAElement("status", choices.extended_register, classifier=ic.Classifier.DYNAMIC),
|
|
16
|
-
ic.ICAElement("capture_time", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC))
|
|
17
|
-
M_ELEMENTS = register.Register.get_meth_element(1),
|
|
18
|
-
|
|
19
|
-
@property
|
|
20
|
-
def status(self) -> choices.ExtendedRegisterValues:
|
|
21
|
-
return self.get_attr(4)
|
|
22
|
-
|
|
23
|
-
@property
|
|
24
|
-
def capture_time(self) -> cdt.DateTime:
|
|
25
|
-
return self.get_attr(5)
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
from . import register
|
|
2
|
+
from .__class_init__ import *
|
|
3
|
+
from ..types import choices
|
|
4
|
+
from .overview import VERSION_0
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ExtendedRegister(register.Register, ic.COSEMInterfaceClasses):
|
|
8
|
+
""" A “Register” object stores a process value or a status value with its associated unit. The register object knows
|
|
9
|
+
the nature of the process value or of the status value. The nature of the value is described by the attribute
|
|
10
|
+
“logical name” using the OBIS identification system. """
|
|
11
|
+
CLASS_ID = ClassID.EXT_REGISTER
|
|
12
|
+
VERSION = VERSION_0
|
|
13
|
+
A_ELEMENTS = (register.Register.get_attr_element(2),
|
|
14
|
+
register.Register.get_attr_element(3),
|
|
15
|
+
ic.ICAElement("status", choices.extended_register, classifier=ic.Classifier.DYNAMIC),
|
|
16
|
+
ic.ICAElement("capture_time", cst.OctetStringDateTime, classifier=ic.Classifier.DYNAMIC))
|
|
17
|
+
M_ELEMENTS = register.Register.get_meth_element(1),
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def status(self) -> choices.ExtendedRegisterValues:
|
|
21
|
+
return self.get_attr(4)
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def capture_time(self) -> cdt.DateTime:
|
|
25
|
+
return self.get_attr(5)
|
|
26
|
+
|
|
27
|
+
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
from . __class_init__ import *
|
|
2
|
-
from .overview import VERSION_0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class QoSElement(cdt.Structure):
|
|
6
|
-
""" Params of element """
|
|
7
|
-
precedence: cdt.Unsigned
|
|
8
|
-
delay: cdt.Unsigned
|
|
9
|
-
reliability: cdt.Unsigned
|
|
10
|
-
peak_throughput: cdt.Unsigned
|
|
11
|
-
mean_throughput: cdt.Unsigned
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class QualityOfService(cdt.Structure):
|
|
15
|
-
""" Specifies the quality of service parameters. It is a structure of 2 elements:
|
|
16
|
-
1: defines the default or minimum characteristics of the network concerned. These parameters have to be set to best effort value;
|
|
17
|
-
2: defines the requested parameters. """
|
|
18
|
-
default: QoSElement
|
|
19
|
-
requested: QoSElement
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class GPRSModemSetup(ic.COSEMInterfaceClasses):
|
|
23
|
-
""" This IC allow setting up GPRS modems, by handling all data necessary data for modem management. """
|
|
24
|
-
CLASS_ID = ClassID.GPRS_MODEM_SETUP
|
|
25
|
-
VERSION = VERSION_0
|
|
26
|
-
A_ELEMENTS = (ic.ICAElement("APN", cdt.OctetString),
|
|
27
|
-
ic.ICAElement("PIN_code", cdt.LongUnsigned),
|
|
28
|
-
ic.ICAElement("quality_of_service", QualityOfService))
|
|
29
|
-
|
|
30
|
-
def characteristics_init(self):
|
|
31
|
-
"""nothing do it"""
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def APN(self) -> cdt.OctetString:
|
|
35
|
-
return self.get_attr(2)
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def PIN_code(self) -> cdt.LongUnsigned:
|
|
39
|
-
return self.get_attr(3)
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def quality_of_service(self) -> QualityOfService:
|
|
43
|
-
return self.get_attr(4)
|
|
1
|
+
from . __class_init__ import *
|
|
2
|
+
from .overview import VERSION_0
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class QoSElement(cdt.Structure):
|
|
6
|
+
""" Params of element """
|
|
7
|
+
precedence: cdt.Unsigned
|
|
8
|
+
delay: cdt.Unsigned
|
|
9
|
+
reliability: cdt.Unsigned
|
|
10
|
+
peak_throughput: cdt.Unsigned
|
|
11
|
+
mean_throughput: cdt.Unsigned
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class QualityOfService(cdt.Structure):
|
|
15
|
+
""" Specifies the quality of service parameters. It is a structure of 2 elements:
|
|
16
|
+
1: defines the default or minimum characteristics of the network concerned. These parameters have to be set to best effort value;
|
|
17
|
+
2: defines the requested parameters. """
|
|
18
|
+
default: QoSElement
|
|
19
|
+
requested: QoSElement
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class GPRSModemSetup(ic.COSEMInterfaceClasses):
|
|
23
|
+
""" This IC allow setting up GPRS modems, by handling all data necessary data for modem management. """
|
|
24
|
+
CLASS_ID = ClassID.GPRS_MODEM_SETUP
|
|
25
|
+
VERSION = VERSION_0
|
|
26
|
+
A_ELEMENTS = (ic.ICAElement("APN", cdt.OctetString),
|
|
27
|
+
ic.ICAElement("PIN_code", cdt.LongUnsigned),
|
|
28
|
+
ic.ICAElement("quality_of_service", QualityOfService))
|
|
29
|
+
|
|
30
|
+
def characteristics_init(self):
|
|
31
|
+
"""nothing do it"""
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def APN(self) -> cdt.OctetString:
|
|
35
|
+
return self.get_attr(2)
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def PIN_code(self) -> cdt.LongUnsigned:
|
|
39
|
+
return self.get_attr(3)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def quality_of_service(self) -> QualityOfService:
|
|
43
|
+
return self.get_attr(4)
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
from ..__class_init__ import *
|
|
4
|
-
from ...config_parser import get_message
|
|
5
|
-
from ..overview import VERSION_0
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Status(cdt.Enum, elements=tuple(range(6))):
|
|
9
|
-
""" Indicates the registration status of the modem. """
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CSAttachment(cdt.Enum, elements=(0, 1, 2)):
|
|
13
|
-
""" Indicates the current circuit switched status."""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class PSStatus(cdt.Enum, elements=tuple(range(5))):
|
|
17
|
-
""" Indicates the packet switched status of the modem. """
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class SignalQuality(cdt.IntegerEnum, cdt.Unsigned):
|
|
21
|
-
"""for string report"""
|
|
22
|
-
def __init_subclass__(cls, **kwargs):
|
|
23
|
-
"""not need"""
|
|
24
|
-
|
|
25
|
-
def get_report(self) -> cdt.Report:
|
|
26
|
-
val = int(self)
|
|
27
|
-
if val == 0:
|
|
28
|
-
return cdt.Report(get_message(F"({val}) –113 dBm $or$ $less$(0)"))
|
|
29
|
-
elif val == 1:
|
|
30
|
-
return cdt.Report(F"({val}) –111 dBm")
|
|
31
|
-
elif val < 31:
|
|
32
|
-
return cdt.Report(get_message(F"({val}) {-109+(val-2)*2} dBm"))
|
|
33
|
-
elif val == 31:
|
|
34
|
-
return cdt.Report(get_message(F"({val}) –51 dBm $or$ $greater$"))
|
|
35
|
-
elif val == 99:
|
|
36
|
-
return cdt.Report(get_message(F"({val}) $not_known_or_not_detectable$"))
|
|
37
|
-
else:
|
|
38
|
-
return cdt.Report(
|
|
39
|
-
msg=F"({val})",
|
|
40
|
-
log=cdt.Log(logging.WARN, "unknown value"))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class CellInfoType(cdt.Structure):
|
|
44
|
-
""" Params of element """
|
|
45
|
-
cell_ID: cdt.LongUnsigned
|
|
46
|
-
location_ID: cdt.LongUnsigned
|
|
47
|
-
signal_quality: SignalQuality
|
|
48
|
-
ber: cdt.Unsigned
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class AdjacentCellInfo(cdt.Structure):
|
|
52
|
-
cell_ID: cdt.LongUnsigned
|
|
53
|
-
signal_quality: SignalQuality
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class AdjacentCells(cdt.Array):
|
|
57
|
-
TYPE = AdjacentCellInfo
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class GSMDiagnostic(ic.COSEMInterfaceClasses):
|
|
61
|
-
""" The GSM/GPRS network is undergoing constant changes in terms of registration status, signal quality etc. It is necessary to monitor and log the relevant parameters in order
|
|
62
|
-
to obtain diagnostic information that allows identifying communication problems in the network. An instance of the 'GSM diagnostic' class stores parameters of the GSM/GPRS
|
|
63
|
-
network necessary for analysing the operation of the network."""
|
|
64
|
-
CLASS_ID = ClassID.GSM_DIAGNOSTIC
|
|
65
|
-
VERSION = VERSION_0
|
|
66
|
-
A_ELEMENTS = (ic.ICAElement("operator", cdt.VisibleString, classifier=ic.Classifier.DYNAMIC),
|
|
67
|
-
ic.ICAElement("status", Status, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
68
|
-
ic.ICAElement("cs_attachment", CSAttachment, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
69
|
-
ic.ICAElement("ps_status", PSStatus, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
70
|
-
ic.ICAElement("cell_info", CellInfoType, classifier=ic.Classifier.DYNAMIC),
|
|
71
|
-
ic.ICAElement("adjacent_cell", AdjacentCells, classifier=ic.Classifier.DYNAMIC),
|
|
72
|
-
ic.ICAElement("capture_time", cdt.DateTime, classifier=ic.Classifier.DYNAMIC))
|
|
73
|
-
|
|
74
|
-
def characteristics_init(self):
|
|
75
|
-
"""nothing do it"""
|
|
76
|
-
|
|
77
|
-
@property
|
|
78
|
-
def operator(self) -> cdt.VisibleString:
|
|
79
|
-
return self.get_attr(2)
|
|
80
|
-
|
|
81
|
-
@property
|
|
82
|
-
def status(self) -> Status:
|
|
83
|
-
return self.get_attr(3)
|
|
84
|
-
|
|
85
|
-
@property
|
|
86
|
-
def cs_attachment(self) -> CSAttachment:
|
|
87
|
-
return self.get_attr(4)
|
|
88
|
-
|
|
89
|
-
@property
|
|
90
|
-
def ps_status(self) -> PSStatus:
|
|
91
|
-
return self.get_attr(5)
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def cell_info(self) -> CellInfoType:
|
|
95
|
-
return self.get_attr(6)
|
|
96
|
-
|
|
97
|
-
@property
|
|
98
|
-
def adjacent_cell(self) -> AdjacentCells:
|
|
99
|
-
return self.get_attr(7)
|
|
100
|
-
|
|
101
|
-
@property
|
|
102
|
-
def capture_time(self) -> cdt.DateTime:
|
|
103
|
-
return self.get_attr(8)
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from ..__class_init__ import *
|
|
4
|
+
from ...config_parser import get_message
|
|
5
|
+
from ..overview import VERSION_0
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Status(cdt.Enum, elements=tuple(range(6))):
|
|
9
|
+
""" Indicates the registration status of the modem. """
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CSAttachment(cdt.Enum, elements=(0, 1, 2)):
|
|
13
|
+
""" Indicates the current circuit switched status."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class PSStatus(cdt.Enum, elements=tuple(range(5))):
|
|
17
|
+
""" Indicates the packet switched status of the modem. """
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SignalQuality(cdt.IntegerEnum, cdt.Unsigned):
|
|
21
|
+
"""for string report"""
|
|
22
|
+
def __init_subclass__(cls, **kwargs):
|
|
23
|
+
"""not need"""
|
|
24
|
+
|
|
25
|
+
def get_report(self) -> cdt.Report:
|
|
26
|
+
val = int(self)
|
|
27
|
+
if val == 0:
|
|
28
|
+
return cdt.Report(get_message(F"({val}) –113 dBm $or$ $less$(0)"))
|
|
29
|
+
elif val == 1:
|
|
30
|
+
return cdt.Report(F"({val}) –111 dBm")
|
|
31
|
+
elif val < 31:
|
|
32
|
+
return cdt.Report(get_message(F"({val}) {-109+(val-2)*2} dBm"))
|
|
33
|
+
elif val == 31:
|
|
34
|
+
return cdt.Report(get_message(F"({val}) –51 dBm $or$ $greater$"))
|
|
35
|
+
elif val == 99:
|
|
36
|
+
return cdt.Report(get_message(F"({val}) $not_known_or_not_detectable$"))
|
|
37
|
+
else:
|
|
38
|
+
return cdt.Report(
|
|
39
|
+
msg=F"({val})",
|
|
40
|
+
log=cdt.Log(logging.WARN, "unknown value"))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class CellInfoType(cdt.Structure):
|
|
44
|
+
""" Params of element """
|
|
45
|
+
cell_ID: cdt.LongUnsigned
|
|
46
|
+
location_ID: cdt.LongUnsigned
|
|
47
|
+
signal_quality: SignalQuality
|
|
48
|
+
ber: cdt.Unsigned
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class AdjacentCellInfo(cdt.Structure):
|
|
52
|
+
cell_ID: cdt.LongUnsigned
|
|
53
|
+
signal_quality: SignalQuality
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class AdjacentCells(cdt.Array):
|
|
57
|
+
TYPE = AdjacentCellInfo
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class GSMDiagnostic(ic.COSEMInterfaceClasses):
|
|
61
|
+
""" The GSM/GPRS network is undergoing constant changes in terms of registration status, signal quality etc. It is necessary to monitor and log the relevant parameters in order
|
|
62
|
+
to obtain diagnostic information that allows identifying communication problems in the network. An instance of the 'GSM diagnostic' class stores parameters of the GSM/GPRS
|
|
63
|
+
network necessary for analysing the operation of the network."""
|
|
64
|
+
CLASS_ID = ClassID.GSM_DIAGNOSTIC
|
|
65
|
+
VERSION = VERSION_0
|
|
66
|
+
A_ELEMENTS = (ic.ICAElement("operator", cdt.VisibleString, classifier=ic.Classifier.DYNAMIC),
|
|
67
|
+
ic.ICAElement("status", Status, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
68
|
+
ic.ICAElement("cs_attachment", CSAttachment, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
69
|
+
ic.ICAElement("ps_status", PSStatus, 0, 255, 0, classifier=ic.Classifier.DYNAMIC),
|
|
70
|
+
ic.ICAElement("cell_info", CellInfoType, classifier=ic.Classifier.DYNAMIC),
|
|
71
|
+
ic.ICAElement("adjacent_cell", AdjacentCells, classifier=ic.Classifier.DYNAMIC),
|
|
72
|
+
ic.ICAElement("capture_time", cdt.DateTime, classifier=ic.Classifier.DYNAMIC))
|
|
73
|
+
|
|
74
|
+
def characteristics_init(self):
|
|
75
|
+
"""nothing do it"""
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def operator(self) -> cdt.VisibleString:
|
|
79
|
+
return self.get_attr(2)
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def status(self) -> Status:
|
|
83
|
+
return self.get_attr(3)
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def cs_attachment(self) -> CSAttachment:
|
|
87
|
+
return self.get_attr(4)
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def ps_status(self) -> PSStatus:
|
|
91
|
+
return self.get_attr(5)
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def cell_info(self) -> CellInfoType:
|
|
95
|
+
return self.get_attr(6)
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def adjacent_cell(self) -> AdjacentCells:
|
|
99
|
+
return self.get_attr(7)
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def capture_time(self) -> cdt.DateTime:
|
|
103
|
+
return self.get_attr(8)
|