MCPcopy Index your code
hub / github.com/python/cpython / build_can_frame

Method build_can_frame

Lib/test/test_socket.py:2344–2348  ·  view source on GitHub ↗

Build a CAN frame.

(cls, can_id, data)

Source from the content-addressed store, hash-verified

2342
2343 @classmethod
2344 def build_can_frame(cls, can_id, data):
2345 """Build a CAN frame."""
2346 can_dlc = len(data)
2347 data = data.ljust(8, b'\x00')
2348 return struct.pack(cls.can_frame_fmt, can_id, can_dlc, data)
2349
2350 @classmethod
2351 def dissect_can_frame(cls, frame):

Callers 4

_testSendFrameMethod · 0.95
_testSendMaxFrameMethod · 0.95
_testSendMultiFramesMethod · 0.95
testBCMMethod · 0.95

Calls 2

ljustMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected