DLMS-SPODES 0.87.17__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 -133
- 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.17.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.17.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.17.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
from
|
|
2
|
-
from ..types import choices
|
|
3
|
-
from . import
|
|
4
|
-
from .
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 typing import Optional
|
|
2
|
+
from ..types import choices, cdt
|
|
3
|
+
from .cosem_interface_class import ICAuto, ICAElement, Classifier
|
|
4
|
+
from .Overview import class_id
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Data(ICAuto):
|
|
8
|
+
"""4.3.1 Data"""
|
|
9
|
+
CLASS_ID = class_id.DATA
|
|
10
|
+
VERSION = 0
|
|
11
|
+
A_ELEMENTS = ICAElement(2, "value", choices.common_dt, classifier=Classifier.NOT_SPECIFIC),
|
|
12
|
+
value: Optional[cdt.CommonDataTypes]
|
|
@@ -1,59 +1,32 @@
|
|
|
1
|
-
from
|
|
2
|
-
from ...types import
|
|
3
|
-
from ...types.
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 ...types import choices, cdt, cst
|
|
2
|
+
from ...types.implementations import integers
|
|
3
|
+
from ...types.type_alias import Attr
|
|
4
|
+
from ..cosem_interface_class import ICAuto, ICAElement, ICMElement, Classifier, Cardinality
|
|
5
|
+
from ..Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DemandRegister(ICAuto):
|
|
9
|
+
"""4.3.4.Demand register"""
|
|
10
|
+
CLASS_ID = class_id.DEMAND_REGISTER
|
|
11
|
+
VERSION = 0
|
|
12
|
+
CARDINALITY = Cardinality()
|
|
13
|
+
A_ELEMENTS = (
|
|
14
|
+
ICAElement(2, "current_average_value", choices.register, classifier=Classifier.DYNAMIC),
|
|
15
|
+
ICAElement(3, "last_average_value", choices.register, classifier=Classifier.DYNAMIC),
|
|
16
|
+
ICAElement(4, "scaler_unit", cdt.ScalUnitType),
|
|
17
|
+
ICAElement(5, "status", choices.extended_register, classifier=Classifier.DYNAMIC),
|
|
18
|
+
ICAElement(6, "capture_time", cst.OctetStringDateTime, classifier=Classifier.DYNAMIC),
|
|
19
|
+
ICAElement(7, "start_time_current", cst.OctetStringDateTime, classifier=Classifier.DYNAMIC),
|
|
20
|
+
ICAElement(8, "period", cdt.DoubleLongUnsigned, min=1),
|
|
21
|
+
ICAElement(9, "number_of_periods", cdt.LongUnsigned, min=1, default=1))
|
|
22
|
+
M_ELEMENTS = (
|
|
23
|
+
ICMElement(1, "reset", integers.Only0),
|
|
24
|
+
ICMElement(2, "next_period", integers.Only0))
|
|
25
|
+
current_average_value: Attr
|
|
26
|
+
last_average_value: Attr
|
|
27
|
+
scaler_unit: Attr
|
|
28
|
+
status: Attr
|
|
29
|
+
capture_time: Attr
|
|
30
|
+
start_time_current: Attr
|
|
31
|
+
period: Attr
|
|
32
|
+
number_of_periods: Attr
|
|
@@ -1,74 +1,56 @@
|
|
|
1
|
-
from
|
|
2
|
-
from ..
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
case
|
|
23
|
-
case
|
|
24
|
-
case
|
|
25
|
-
case
|
|
26
|
-
case
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
case
|
|
30
|
-
case
|
|
31
|
-
case
|
|
32
|
-
case
|
|
33
|
-
case
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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 itertools import chain
|
|
2
|
+
from ..config_parser import get_message
|
|
3
|
+
from ..types.implementations import integers
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from ..types import cdt
|
|
6
|
+
from .cosem_interface_class import ICAElement, ICMElement, Classifier, ICAuto
|
|
7
|
+
from .Overview import class_id
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ControlState(cdt.Enum, elements=(0, 1, 2)):
|
|
11
|
+
""" Shows the internal state of the disconnect control object. """
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ControlMode(cdt.Enum, elements=tuple(chain(range(7), range(129, 135)))):
|
|
15
|
+
""" Configures the behaviour of the disconnect control object for all triggers. Local disconnection is always possible.
|
|
16
|
+
To suppress local disconnection, the corresponding trigger must be inhibited. """
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def get_letters(value: int) -> str:
|
|
20
|
+
"""return transition litters"""
|
|
21
|
+
match value:
|
|
22
|
+
case 0: return ""
|
|
23
|
+
case 1: return "bcfgde"
|
|
24
|
+
case 2: return "bcfgae"
|
|
25
|
+
case 3: return "bcgde"
|
|
26
|
+
case 4: return "bcgae"
|
|
27
|
+
case 5: return "bcfgdeh"
|
|
28
|
+
case 6: return "bcgdeh"
|
|
29
|
+
case 129: return "bcfmde"
|
|
30
|
+
case 130: return "bcfmae"
|
|
31
|
+
case 131: return "bcmde"
|
|
32
|
+
case 132: return "bcma"
|
|
33
|
+
case 133: return "bcmak"
|
|
34
|
+
case 134: return "bcmsdep"
|
|
35
|
+
case _: raise ValueError(F"unknown {value=}")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class OutputState(cdt.Boolean):
|
|
39
|
+
""" 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.
|
|
40
|
+
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 """
|
|
41
|
+
def __str__(self):
|
|
42
|
+
return get_message("$disconnected$") if self.contents == b'\x00' else get_message("$connected$")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class DisconnectControl(ICAuto):
|
|
46
|
+
"""4.5.8 Disconnect control"""
|
|
47
|
+
CLASS_ID = class_id.DISCONNECT_CONTROL
|
|
48
|
+
VERSION = 0
|
|
49
|
+
A_ELEMENTS = (ICAElement(2, "output_state", OutputState, classifier=Classifier.DYNAMIC),
|
|
50
|
+
ICAElement(3, "control_state", ControlState, classifier=Classifier.DYNAMIC),
|
|
51
|
+
ICAElement(4, "control_mode", ControlMode))
|
|
52
|
+
M_ELEMENTS = (ICMElement(1, "remote_disconnect", integers.Only0),
|
|
53
|
+
ICMElement(2, "remote_reconnect", integers.Only0))
|
|
54
|
+
output_state: Optional[cdt.Boolean]
|
|
55
|
+
control_state: Optional[ControlState]
|
|
56
|
+
control_mode: Optional[ControlMode]
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
from . import register
|
|
2
|
-
from
|
|
3
|
-
from ..types import choices
|
|
4
|
-
from .
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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 typing import Optional
|
|
3
|
+
from ..types import choices, cdt, cst
|
|
4
|
+
from .cosem_interface_class import ICAElement, Classifier
|
|
5
|
+
from .Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ExtendedRegister(register.Register):
|
|
9
|
+
"""4.3.3 Extended register"""
|
|
10
|
+
CLASS_ID = class_id.EXT_REGISTER
|
|
11
|
+
VERSION = 0
|
|
12
|
+
A_ELEMENTS = (register.Register.getAElement(2).unwrap(),
|
|
13
|
+
register.Register.getAElement(3).unwrap(),
|
|
14
|
+
ICAElement(4, "status", choices.extended_register, classifier=Classifier.DYNAMIC),
|
|
15
|
+
ICAElement(5, "capture_time", cst.OctetStringDateTime, classifier=Classifier.DYNAMIC))
|
|
16
|
+
M_ELEMENTS = register.Register.getMElement(1).unwrap(),
|
|
17
|
+
status: Optional[choices.ExtendedRegisterValues]
|
|
18
|
+
capture_time: Optional[cdt.DateTime]
|
|
@@ -1,43 +1,33 @@
|
|
|
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
|
-
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 typing import Optional
|
|
2
|
+
from ..types import cdt
|
|
3
|
+
from .cosem_interface_class import ICAElement, ICAuto
|
|
4
|
+
from .Overview import class_id
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class QoSElement(cdt.Structure):
|
|
8
|
+
""" Params of element """
|
|
9
|
+
precedence: cdt.Unsigned
|
|
10
|
+
delay: cdt.Unsigned
|
|
11
|
+
reliability: cdt.Unsigned
|
|
12
|
+
peak_throughput: cdt.Unsigned
|
|
13
|
+
mean_throughput: cdt.Unsigned
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class QualityOfService(cdt.Structure):
|
|
17
|
+
""" Specifies the quality of service parameters. It is a structure of 2 elements:
|
|
18
|
+
1: defines the default or minimum characteristics of the network concerned. These parameters have to be set to best effort value;
|
|
19
|
+
2: defines the requested parameters. """
|
|
20
|
+
default: QoSElement
|
|
21
|
+
requested: QoSElement
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GPRSModemSetup(ICAuto):
|
|
25
|
+
""" This IC allow setting up GPRS modems, by handling all data necessary data for modem management. """
|
|
26
|
+
CLASS_ID = class_id.GPRS_MODEM_SETUP
|
|
27
|
+
VERSION = 0
|
|
28
|
+
A_ELEMENTS = (ICAElement(2, "APN", cdt.OctetString),
|
|
29
|
+
ICAElement(3, "PIN_code", cdt.LongUnsigned),
|
|
30
|
+
ICAElement(4, "quality_of_service", QualityOfService))
|
|
31
|
+
APN: Optional[cdt.OctetString]
|
|
32
|
+
PIN_code: Optional[cdt.LongUnsigned]
|
|
33
|
+
quality_of_service: Optional[QualityOfService]
|
|
@@ -1,103 +1,78 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
-
from ...
|
|
5
|
-
from ..
|
|
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
|
-
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
|
+
from ...config_parser import get_message
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from ...types import cdt
|
|
5
|
+
from ..cosem_interface_class import ICAuto, ICAElement, Classifier
|
|
6
|
+
from ..Overview import class_id
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Status(cdt.Enum, elements=tuple(range(6))):
|
|
10
|
+
""" Indicates the registration status of the modem. """
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CSAttachment(cdt.Enum, elements=(0, 1, 2)):
|
|
14
|
+
""" Indicates the current circuit switched status."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PSStatus(cdt.Enum, elements=tuple(range(5))):
|
|
18
|
+
""" Indicates the packet switched status of the modem. """
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SignalQuality(cdt.IntegerEnum, cdt.Unsigned):
|
|
22
|
+
"""for string report"""
|
|
23
|
+
def __init_subclass__(cls, **kwargs):
|
|
24
|
+
"""not need"""
|
|
25
|
+
|
|
26
|
+
def get_report(self) -> cdt.Report:
|
|
27
|
+
val = int(self)
|
|
28
|
+
if val == 0:
|
|
29
|
+
return cdt.Report(get_message(F"({val}) –113 dBm $or$ $less$(0)"))
|
|
30
|
+
elif val == 1:
|
|
31
|
+
return cdt.Report(F"({val}) –111 dBm")
|
|
32
|
+
elif val < 31:
|
|
33
|
+
return cdt.Report(get_message(F"({val}) {-109+(val-2)*2} dBm"))
|
|
34
|
+
elif val == 31:
|
|
35
|
+
return cdt.Report(get_message(F"({val}) –51 dBm $or$ $greater$"))
|
|
36
|
+
elif val == 99:
|
|
37
|
+
return cdt.Report(get_message(F"({val}) $not_known_or_not_detectable$"))
|
|
38
|
+
else:
|
|
39
|
+
return cdt.Report(
|
|
40
|
+
msg=F"({val})",
|
|
41
|
+
log=cdt.Log(logging.WARN, "unknown value"))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class CellInfoType(cdt.Structure):
|
|
45
|
+
""" Params of element """
|
|
46
|
+
cell_ID: cdt.LongUnsigned
|
|
47
|
+
location_ID: cdt.LongUnsigned
|
|
48
|
+
signal_quality: SignalQuality
|
|
49
|
+
ber: cdt.Unsigned
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AdjacentCellInfo(cdt.Structure):
|
|
53
|
+
cell_ID: cdt.LongUnsigned
|
|
54
|
+
signal_quality: SignalQuality
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AdjacentCells(cdt.Array):
|
|
58
|
+
TYPE = AdjacentCellInfo
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class GSMDiagnostic(ICAuto):
|
|
62
|
+
"""4.7.8 GSM diagnostic"""
|
|
63
|
+
CLASS_ID = class_id.GSM_DIAGNOSTIC
|
|
64
|
+
VERSION = 0
|
|
65
|
+
A_ELEMENTS = (ICAElement(2, "operator", cdt.VisibleString, classifier=Classifier.DYNAMIC),
|
|
66
|
+
ICAElement(3, "status", Status, 0, 255, 0, classifier=Classifier.DYNAMIC),
|
|
67
|
+
ICAElement(4, "cs_attachment", CSAttachment, 0, 255, 0, classifier=Classifier.DYNAMIC),
|
|
68
|
+
ICAElement(5, "ps_status", PSStatus, 0, 255, 0, classifier=Classifier.DYNAMIC),
|
|
69
|
+
ICAElement(6, "cell_info", CellInfoType, classifier=Classifier.DYNAMIC),
|
|
70
|
+
ICAElement(7, "adjacent_cell", AdjacentCells, classifier=Classifier.DYNAMIC),
|
|
71
|
+
ICAElement(8, "capture_time", cdt.DateTime, classifier=Classifier.DYNAMIC))
|
|
72
|
+
operator: Optional[cdt.VisibleString]
|
|
73
|
+
status: Optional[Status]
|
|
74
|
+
cs_attachment: Optional[CSAttachment]
|
|
75
|
+
ps_status: Optional[PSStatus]
|
|
76
|
+
cell_info: Optional[CellInfoType]
|
|
77
|
+
adjacent_cell: Optional[AdjacentCells]
|
|
78
|
+
capture_time: Optional[cdt.DateTime]
|