DLMS-SPODES-client 0.19.20__py3-none-any.whl → 0.19.21__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 +15 -18
- {dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/METADATA +1 -1
- {dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/RECORD +6 -6
- {dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/WHEEL +0 -0
- {dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/entry_points.txt +0 -0
- {dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/top_level.txt +0 -0
DLMS_SPODES_client/client.py
CHANGED
|
@@ -260,12 +260,12 @@ class Client:
|
|
|
260
260
|
case _: raise ValueError(F"can't calculate channel index by media: {self.media}")
|
|
261
261
|
|
|
262
262
|
def get_frame(self, read_data: bytearray, reply: GXReplyData) -> frame.Frame | None:
|
|
263
|
+
reply.complete = False
|
|
263
264
|
while len(read_data) != 0:
|
|
264
265
|
new_frame = frame.Frame.try_from(read_data)
|
|
265
|
-
|
|
266
|
-
if new_frame is None:
|
|
267
|
-
reply.complete = False
|
|
266
|
+
if not isinstance(new_frame, frame.Frame):
|
|
268
267
|
return None
|
|
268
|
+
reply.complete = True
|
|
269
269
|
if new_frame.is_for_me(self.DA, self.SA):
|
|
270
270
|
self.received_frames.append(new_frame)
|
|
271
271
|
if new_frame.is_segmentation:
|
|
@@ -319,7 +319,7 @@ class Client:
|
|
|
319
319
|
len_ = _GXCommon.getObjectCount(reply.data)
|
|
320
320
|
if len_ > reply.data.size - reply.data.position:
|
|
321
321
|
reply.complete = False
|
|
322
|
-
return
|
|
322
|
+
return result.Error.from_e(RuntimeError("not enouth reply data size"))
|
|
323
323
|
GXDLMS.getDataFromBlock(reply.data, index)
|
|
324
324
|
if (bc & 0x80) == 0:
|
|
325
325
|
reply.moreData = (RequestTypes(reply.moreData | RequestTypes.GBT))
|
|
@@ -758,22 +758,19 @@ class Client:
|
|
|
758
758
|
self.log(logL.INFO, F"TX: {send_frame.content.hex(" ")}")
|
|
759
759
|
attempt: int = 1
|
|
760
760
|
while attempt < 3:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
fut=self.media.receive(recv_buf),
|
|
764
|
-
timeout=self.com_profile.parameters.inactivity_time_out) # todo: only for HDLC
|
|
765
|
-
if self.__is_frame(notify, recv_buf, reply):
|
|
766
|
-
break
|
|
767
|
-
elif notify.data.size != 0:
|
|
768
|
-
if not notify.isMoreData():
|
|
769
|
-
notify.clear()
|
|
770
|
-
continue
|
|
771
|
-
else:
|
|
772
|
-
"""our frame not was found"""
|
|
773
|
-
except TimeoutError as e:
|
|
774
|
-
self.log(logL.WARN, F'Data send failed: {e}. Try to resend {attempt+1}/3. RX_buffer: {recv_buf.hex(" ")}')
|
|
761
|
+
if not await self.media.receive(recv_buf): # todo: make for BLE
|
|
762
|
+
self.log(logL.WARN, F'Data receive failed: Try to resend {attempt + 1}/3. RX_buffer: {recv_buf.hex(" ")}')
|
|
775
763
|
await self.media.send(send_frame.content)
|
|
776
764
|
attempt += 1
|
|
765
|
+
continue
|
|
766
|
+
if self.__is_frame(notify, recv_buf, reply):
|
|
767
|
+
break
|
|
768
|
+
if notify.data.size != 0:
|
|
769
|
+
if not notify.isMoreData():
|
|
770
|
+
notify.clear()
|
|
771
|
+
continue
|
|
772
|
+
else:
|
|
773
|
+
"""our frame not was found"""
|
|
777
774
|
else:
|
|
778
775
|
return result.Error.from_e(TimeoutError("Failed to receive reply from the device in given time"), "read data block")
|
|
779
776
|
recv_buf.clear()
|
|
@@ -1,6 +1,6 @@
|
|
|
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=lsMLRLfgbISLOpaUPJme0-4631A0ZgQBOAVqjkQjvH4,112156
|
|
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
|
|
@@ -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.21.dist-info/METADATA,sha256=diEibtEXXEZhLaSqJgunuNJ2uMuN5pjSTAtl3QSPVqU,986
|
|
58
|
+
dlms_spodes_client-0.19.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
59
|
+
dlms_spodes_client-0.19.21.dist-info/entry_points.txt,sha256=Z6UTeQjjCf2k1Y3Bjs0s7yr-UYSWb-TvJMuG2K2MApw,70
|
|
60
|
+
dlms_spodes_client-0.19.21.dist-info/top_level.txt,sha256=rh_3Uig5bc6J_lKni01btol7dX_IgIJulNtGjGehmBE,19
|
|
61
|
+
dlms_spodes_client-0.19.21.dist-info/RECORD,,
|
|
File without changes
|
{dlms_spodes_client-0.19.20.dist-info → dlms_spodes_client-0.19.21.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|