Skip to content

Commit

Permalink
Fix string passing to c_char_p for Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
aigarius authored Sep 19, 2023
1 parent 809af0d commit 829f4fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dlt/dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ def read_message(self, verbose=False):
if msg.standardheader.htyp & DLT_HTYP_WEID:
dltlib.dlt_set_storageheader(msg.p_storageheader, msg.headerextra.ecu)
else:
dltlib.dlt_set_storageheader(msg.p_storageheader, ctypes.c_char_p(""))
dltlib.dlt_set_storageheader(msg.p_storageheader, ctypes.c_char_p(b""))

return msg

Expand All @@ -1038,7 +1038,7 @@ def msg_callback(msg, data): # pylint: disable=no-self-argument
if msg.contents.p_standardheader.contents.htyp & DLT_HTYP_WEID:
dltlib.dlt_set_storageheader(msg.contents.p_storageheader, msg.contents.headerextra.ecu)
else:
dltlib.dlt_set_storageheader(msg.contents.p_storageheader, ctypes.c_char_p(""))
dltlib.dlt_set_storageheader(msg.contents.p_storageheader, ctypes.c_char_p(b""))

print(msg.contents)
return 0
Expand Down

0 comments on commit 829f4fd

Please sign in to comment.