Re: How to statically set J1939 addresses and names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le ven. 11 juin 2021 à 08:57, Kurt Van Dijck
<dev.kurt@xxxxxxxxxxxxxxxxxxxxxx> a écrit :
>
> On Fri, 11 Jun 2021 06:12:32 +0200, Oleksij Rempel wrote:
> > Hi Rémy,
> >
> > On Tue, Jun 08, 2021 at 05:27:45PM +0200, Rémy DZIEMIASZKO wrote:
> > > Hello,
> > >
> > > I need that my applications do not care about J1939 node addresses but
> > > directly bind / connect to socket based on node name only and the
> > > kernel takes care of the conversion to addresses.
> > >
> > > I know this is possible if addresses are dynamically assigned through
> > > the Address Claiming protocol that is implemented in the kernel. The
> > > kernel keeps track of its own address and name as well as the
> > > addresses and names of other ECUs on the network and convert name to
> > > adresse when requested by the applications.
> > >
> > > But I don't want to use the Address Claiming protocol. I want to
> > > statically set all addresses and names.
>
> It is supported to not use Address Claiming.
>
> > >
> > > Is there a way to assign J1939 addresses and names to a CAN interface
> > > without using the J1939 address claim protocol?
> >
> > Current version do not have this functionality.
>
> If you bind() your socket with only sockaddr_can.j1939.sa set to your
> SA, and sockaddr_can.j1939.name to 0, makes your socket use your SA as
> static address.
>
> >
> > > I found in old j1939 kernel documentation something like
> > > ip addr add dev canX j1939 0xXX
> > > ip addr add dev canX j1939 name 0xXX
> > > See https://www.spinics.net/lists/netdev/msg162350.html
> > >
> > > But in the latest j1939 kernel documentation I do not find any
> > > reference to these commands.
> >
> > Yes, it was pre mainline version. For mainlining we reduced UAPI to the
> > minimum to simplify reviewing, mainlining and testing process.
> >
>
> The strict addressing was rejected because it felt much heavier than
> what most CAN users were used to. Moving to the current ad-hoc
> implementation allowed to drop quite some kernel code too.
>
Hi Kurt,

When I develop my application I don't know it's source address. I only
know its name.
In the future my application shall be integrated in different
projects/vehicules.
For each project, the source_address may be different but the name
will never change.
I don't want to adapt the source code of the application for each
project so I don't want to bind/connect to source_addresses but to
names.
That's why it would be nice if the platform / the kernel does the
translation name --> source_address.




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux