Linux CAN drivers development
 help / color / mirror / Atom feed
* Setting CAN FD data bitrate with libsocketcan
@ 2017-09-09 18:08 André Hartmann
  2017-09-10 11:25 ` Lars Susaas
  0 siblings, 1 reply; 4+ messages in thread
From: André Hartmann @ 2017-09-09 18:08 UTC (permalink / raw)
  To: linux-can

Hi all,

libsocketcan [1] allows to set the CAN bus bitrate from an application 
with can_set_bitrate().

However, I did not find a possibility to set the CAN FD data bitrate.
Is there a way or does no such function exist yet? If it does not exist, 
are there plans to support it?

Thanks in advance,
André

[1] https://git.pengutronix.de/cgit/tools/libsocketcan/

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

* Re: Setting CAN FD data bitrate with libsocketcan
  2017-09-09 18:08 Setting CAN FD data bitrate with libsocketcan André Hartmann
@ 2017-09-10 11:25 ` Lars Susaas
  2017-09-12 19:26   ` André Hartmann
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Susaas @ 2017-09-10 11:25 UTC (permalink / raw)
  To: André Hartmann; +Cc: linux-can

> However, I did not find a possibility to set the CAN FD data bitrate.
> Is there a way or does no such function exist yet? If it does not exist, are
> there plans to support it?

Hi,

Was looking for the same thing a little while back.
Did not find it, so i made some changes to libsocketcan as part of my
work on canFestival (canOpen stack)

You can check out work here:
https://bitbucket.org/nimrof/canfestival-3-asc/src/53f18ae80f39901b61ddf6d04b9358893ac518db/drivers/can_socket?at=canfd

Just copy the following files into libsocketcan:
can_netlink.h
libsocketcan.c
libsocketcan.h

Its yet testet that well, so may contain bugs.

To set the databaudrate you have to set baudrate first with
'can_set_bitrate' then you can use 'can_set_data_bitrate'.

Feedback welcome

best regards
Lars

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

* Re: Setting CAN FD data bitrate with libsocketcan
  2017-09-10 11:25 ` Lars Susaas
@ 2017-09-12 19:26   ` André Hartmann
  2017-09-14 19:41     ` Lars Susaas
  0 siblings, 1 reply; 4+ messages in thread
From: André Hartmann @ 2017-09-12 19:26 UTC (permalink / raw)
  To: Lars Susaas; +Cc: linux-can

Hi Lars,

thanks for your answer.

Am 10.09.2017 um 13:25 schrieb Lars Susaas:
>> However, I did not find a possibility to set the CAN FD data bitrate.
>> Is there a way or does no such function exist yet? If it does not exist, are
>> there plans to support it?
> 
> Hi,
> 
> Was looking for the same thing a little while back.
> Did not find it, so i made some changes to libsocketcan as part of my
> work on canFestival (canOpen stack)

Ah Ok, I like to use it for QtSerialBus [1]. Therefore I'm a bit limited 
with including 3rd party libraries (licenses and so) and we decided to 
use the system-wide libsocketcan. Which now turns out to miss (at least) 
one feature.

> You can check out work here:
> https://bitbucket.org/nimrof/canfestival-3-asc/src/53f18ae80f39901b61ddf6d04b9358893ac518db/drivers/can_socket?at=canfd
> 
> Just copy the following files into libsocketcan:
> can_netlink.h
> libsocketcan.c
> libsocketcan.h
> 
> Its yet testet that well, so may contain bugs.
> 
> To set the databaudrate you have to set baudrate first with
> 'can_set_bitrate' then you can use 'can_set_data_bitrate'.

I will definitely have a look this weekend. Have you considered 
upstreaming your changes back to libsocketcan?

Best regards,
André

[1] http://code.qt.io/cgit/qt/qtserialbus.git/

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

* Re: Setting CAN FD data bitrate with libsocketcan
  2017-09-12 19:26   ` André Hartmann
@ 2017-09-14 19:41     ` Lars Susaas
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Susaas @ 2017-09-14 19:41 UTC (permalink / raw)
  To: André Hartmann; +Cc: linux-can

Hi André,


On Tue, Sep 12, 2017 at 9:26 PM, André Hartmann <aha_1980@gmx.de> wrote:
> I will definitely have a look this weekend. Have you considered upstreaming
> your changes back to libsocketcan?

Very nice if you have the time to check it out.
I definitely want to upstream, but i think it needs more testing and
maybe a cleanup of comments and code before that time.

My plan was first to get my changes to canFestival done and then turn
my focus to libsocketcan, but if other people have the need for
libsocketcan with can FD support i that will change :)

Best regards
Lars

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

end of thread, other threads:[~2017-09-14 19:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-09 18:08 Setting CAN FD data bitrate with libsocketcan André Hartmann
2017-09-10 11:25 ` Lars Susaas
2017-09-12 19:26   ` André Hartmann
2017-09-14 19:41     ` Lars Susaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox