Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jun 6, 2024
1 parent 7255286 commit 5715873
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions can/packer_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ cdef class CANPacker:
cpdef make_can_msg(self, name_or_addr, bus, values):
cdef const Msg* m
if isinstance(name_or_addr, int):
m = self.dbc.addr_to_msg.at(name_or_addr)
addr = name_or_addr
else:
m = self.dbc.name_to_msg.at(name_or_addr.encode("utf8"))
addr = m.address

cdef vector[uint8_t] val = self.pack(m.address, values)
return [m.address, 0, (<char *>&val[0])[:val.size()], bus]
cdef vector[uint8_t] val = self.pack(addr, values)
return [addr, 0, (<char *>&val[0])[:val.size()], bus]

0 comments on commit 5715873

Please sign in to comment.