All of lore.kernel.org
 help / color / mirror / Atom feed
* J1939 Questions on Intended usage
@ 2021-05-14 12:04 Patrick Menschel
  2021-05-15 12:26 ` Kurt Van Dijck
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Menschel @ 2021-05-14 12:04 UTC (permalink / raw)
  To: dev.kurt, linux-can

Hi Kurt,

J1939 just hit the raspberrypi-kernel-headers and will soon be part of
regular raspberrypi-kernel [1] while it was already
available in Python 3.9 for a couple of month. [2]

I was about to give it a spin but was confused of the call parameters.

Could you shed some light on the intended usage.

Do I need to open one socket per PGN I'm sending?
e.g.

s1 = socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939)
s1.bind(interface_name, MY_NAME, PGN_OF_TSC1, MY_SA)
s1.write(bytes(8))

s2 = socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939)
s2.bind(interface_name, MY_NAME, PGN_OF_EBC1, MY_SA)
s2.write(bytes(8))


What about the cyclic transmitted PGNs? Do I drop those into
BroadcastManager somehow?


If I want to open an ISOTP Channel while a j1939 socket exists for my
SA, does anything weird happen on that socket?

e.g. I open a KWP2000 session from tester to engine ecu:

Tester 0xF1 <--> ECU 0x00
0x18DA00F1  >>
            << 0x18DAF100

Thanks and Best Regards,
Patrick Menschel



[1] https://github.com/raspberrypi/linux/pull/4346
[2] https://docs.python.org/3.9/library/socket.html#socket.socket.bind
> CAN_J1939 protocol require a tuple (interface, name, pgn, addr) where additional
> parameters are 64-bit unsigned integer representing the ECU name, a32-bit unsigned
> integer representing the Parameter Group Number (PGN), and an 8-bit integer
> representing the address.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-15 19:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 12:04 J1939 Questions on Intended usage Patrick Menschel
2021-05-15 12:26 ` Kurt Van Dijck
2021-05-15 14:01   ` Patrick Menschel
2021-05-15 18:10     ` Patrick Menschel
2021-05-15 18:41       ` Marc Kleine-Budde
2021-05-15 18:42       ` Kurt Van Dijck
2021-05-15 19:00         ` Patrick Menschel
2021-05-15 19:07           ` Kurt Van Dijck
2021-05-15 19:17           ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.