Skip to content

Commit

Permalink
Merge pull request #61 from bmwcarit/c_char_p_fix
Browse files Browse the repository at this point in the history
Fix string passing to c_char_p for Python3
  • Loading branch information
yen3 authored Sep 20, 2023
2 parents 809af0d + 829f4fd commit 3c3a8da
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 3c3a8da

Please sign in to comment.