DLMS-SPODES-client 0.19.25__py3-none-any.whl → 0.19.27__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_client/client.py +6 -3
- DLMS_SPODES_client/task.py +9 -3
- {dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/METADATA +1 -1
- {dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/RECORD +7 -7
- {dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/WHEEL +0 -0
- {dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/entry_points.txt +0 -0
- {dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/top_level.txt +0 -0
DLMS_SPODES_client/client.py
CHANGED
|
@@ -338,7 +338,7 @@ class Client:
|
|
|
338
338
|
# TODO: make return pdu
|
|
339
339
|
if reply.command is None:
|
|
340
340
|
if reply.data.size - reply.data.position == 0:
|
|
341
|
-
return result.Error(ValueError("Invalid PDU"), "getpdu")
|
|
341
|
+
return result.Error.from_e(ValueError("Invalid PDU"), "getpdu")
|
|
342
342
|
index = reply.data.position
|
|
343
343
|
reply.command = XDLMSAPDU(reply.data.getUInt8())
|
|
344
344
|
match reply.command:
|
|
@@ -444,7 +444,7 @@ class Client:
|
|
|
444
444
|
case pdu.ActionResponse.NORMAL:
|
|
445
445
|
reply.error = pdu.ActionResult(reply.data.getUInt8())
|
|
446
446
|
if reply.error != 0:
|
|
447
|
-
return result.Error(exc.ResultError(reply.error), "get pdu")
|
|
447
|
+
return result.Error.from_e(exc.ResultError(reply.error), "get pdu")
|
|
448
448
|
if reply.data.position < reply.data.size:
|
|
449
449
|
ret = reply.data.getUInt8()
|
|
450
450
|
if ret == 0:
|
|
@@ -780,7 +780,10 @@ class Client:
|
|
|
780
780
|
return result.Error.from_e(exc.NoObject(), "read data block")
|
|
781
781
|
case _:
|
|
782
782
|
return result.Error.from_e(GXDLMSException(reply.error), "read data block")
|
|
783
|
-
if
|
|
783
|
+
if (
|
|
784
|
+
self.received_frames[-1].control.is_info()
|
|
785
|
+
or self.received_frames[-1].control == frame.Control.UI_PF
|
|
786
|
+
):
|
|
784
787
|
if self.received_frames[-1].is_segmentation:
|
|
785
788
|
"""pass handle frame. wait all information"""
|
|
786
789
|
else:
|
DLMS_SPODES_client/task.py
CHANGED
|
@@ -104,7 +104,7 @@ class Base[T: result.Result](Protocol):
|
|
|
104
104
|
return res_terminate
|
|
105
105
|
return ret
|
|
106
106
|
|
|
107
|
-
async def DL_connect(self, c: Client) ->
|
|
107
|
+
async def DL_connect(self, c: Client) -> result.Ok | result.Error:
|
|
108
108
|
"""Data link Layer connect"""
|
|
109
109
|
c.send_frames.clear()
|
|
110
110
|
# calculate addresses todo: move to c.com_profile(HDLC)
|
|
@@ -128,10 +128,12 @@ class Base[T: result.Result](Protocol):
|
|
|
128
128
|
if isinstance(res_pdu := await c.read_data_block(), result.Error):
|
|
129
129
|
return res_pdu
|
|
130
130
|
c.level |= OSI.DATA_LINK
|
|
131
|
+
return result.OK
|
|
131
132
|
|
|
132
133
|
async def data_link(self, c: Client) -> T | result.Error:
|
|
133
134
|
if OSI.DATA_LINK not in c.level:
|
|
134
|
-
await self.DL_connect(c)
|
|
135
|
+
if isinstance(res_conn := await self.DL_connect(c), result.Error):
|
|
136
|
+
return res_conn
|
|
135
137
|
# todo: make tile
|
|
136
138
|
return await self.application(c)
|
|
137
139
|
|
|
@@ -212,7 +214,11 @@ class Base[T: result.Result](Protocol):
|
|
|
212
214
|
if isinstance(res_pdu := await c.read_data_block(), result.Error):
|
|
213
215
|
return res_pdu
|
|
214
216
|
# await c.read_attr(ut.CosemAttributeDescriptor((collection.ClassID.ASSOCIATION_LN, ut.CosemObjectInstanceId("0.0.40.0.0.255"), ut.CosemObjectAttributeId(6)))) # for test only
|
|
215
|
-
|
|
217
|
+
try:
|
|
218
|
+
parse = c.parseAareResponse(res_pdu.value)
|
|
219
|
+
except IndexError as e:
|
|
220
|
+
print(e)
|
|
221
|
+
match parse:
|
|
216
222
|
case AcseServiceUser.NULL:
|
|
217
223
|
c.log(logL.INFO, "Authentication success")
|
|
218
224
|
c.level |= OSI.APPLICATION
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
DLMS_SPODES_client/FCS16.py,sha256=RhoN4fX7eesKWfWCkRT_uWNfiQHqFd3T6lRwxfamUqw,2697
|
|
2
2
|
DLMS_SPODES_client/__init__.py,sha256=6wphXvqkodng7h4nKNmkfldbaxf--IDVGfT0yNbas-o,449
|
|
3
|
-
DLMS_SPODES_client/client.py,sha256=
|
|
3
|
+
DLMS_SPODES_client/client.py,sha256=HnsbECdBGzrlyT0RzNGweIBms5LKRNP4uUMSmaMEPIA,112148
|
|
4
4
|
DLMS_SPODES_client/logger.py,sha256=zAbihLloMU99w8Sw3djQ0cwItzyGq0Fz8DI9_suazv4,1913
|
|
5
5
|
DLMS_SPODES_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
DLMS_SPODES_client/services.py,sha256=xM_-h322V1bGBcw9cJh7XOSUMTL3_E-GX89-z3YwIYw,3909
|
|
7
7
|
DLMS_SPODES_client/session.py,sha256=nPzXujpmGSTFFvhyZRjgH_RLX1DS9moRddUEZuf-QEE,12760
|
|
8
8
|
DLMS_SPODES_client/settings.py,sha256=6mitGe9UYeEgL61sf933MJ-S5N-ReoxvXqiI3agBGYE,1623
|
|
9
|
-
DLMS_SPODES_client/task.py,sha256=
|
|
9
|
+
DLMS_SPODES_client/task.py,sha256=hylTkESBK3J8xVksmLGGhdGiI0tYNnkqShThZioaGN0,78300
|
|
10
10
|
DLMS_SPODES_client/gurux_common/enums/TraceLevel.py,sha256=Ne0Rn3c9ACqQjmde_ksbiQxIUv6nXsPQRnhkGwIv3QI,521
|
|
11
11
|
DLMS_SPODES_client/gurux_common/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
DLMS_SPODES_client/gurux_dlms/AesGcmParameter.py,sha256=HJt0uvxtkqKEkvfiqXTMNsiayN15AgPJa9_iMSSFZsQ,1429
|
|
@@ -54,8 +54,8 @@ DLMS_SPODES_client/gurux_dlms/enums/Task.py,sha256=chuOL6-IMxBvABUZtoFcaYaQQB4GZ
|
|
|
54
54
|
DLMS_SPODES_client/gurux_dlms/enums/VdeStateError.py,sha256=qT87LMbIYEs3TYPIp3N-dR2Tcg9KhKyiELwhVl5U-tw,233
|
|
55
55
|
DLMS_SPODES_client/gurux_dlms/enums/__init__.py,sha256=F_sgGwNmmdpbKvP1klJQUNiLXxU2BtZ-LgEI9e6xP8g,1314
|
|
56
56
|
DLMS_SPODES_client/gurux_dlms/internal/_GXCommon.py,sha256=7D9EYcfiZxwbk8sfpHv7s2nYqrbmGf-Tbwv2T-gqmgk,53226
|
|
57
|
-
dlms_spodes_client-0.19.
|
|
58
|
-
dlms_spodes_client-0.19.
|
|
59
|
-
dlms_spodes_client-0.19.
|
|
60
|
-
dlms_spodes_client-0.19.
|
|
61
|
-
dlms_spodes_client-0.19.
|
|
57
|
+
dlms_spodes_client-0.19.27.dist-info/METADATA,sha256=be94iVnDwl0ng1Xn9cUQWwK_BMlkVTboSIqkemsBeUQ,1062
|
|
58
|
+
dlms_spodes_client-0.19.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
59
|
+
dlms_spodes_client-0.19.27.dist-info/entry_points.txt,sha256=Z6UTeQjjCf2k1Y3Bjs0s7yr-UYSWb-TvJMuG2K2MApw,70
|
|
60
|
+
dlms_spodes_client-0.19.27.dist-info/top_level.txt,sha256=rh_3Uig5bc6J_lKni01btol7dX_IgIJulNtGjGehmBE,19
|
|
61
|
+
dlms_spodes_client-0.19.27.dist-info/RECORD,,
|
|
File without changes
|
{dlms_spodes_client-0.19.25.dist-info → dlms_spodes_client-0.19.27.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|