Hi Oliver,

Sorry I rolled out new version just two seconds beyond I saw your mail.
Will consider the changes for further incarnations.

On Wed, Nov 25, 2009 at 04:49:11PM +0100, Oliver Hartkopp wrote:
> Wolfgang Grandegger wrote:
> > Luotao Fu wrote:
> >> Hi Wolfgang,
> >>
> >> On Tue, Nov 24, 2009 at 03:46:22PM +0100, Wolfgang Grandegger wrote:
> >>> Hi Fu,
> >>>
> >>> Luotao Fu wrote:
> >>>> Hi folks,
> >>>>
> >>>> I was trying to integrate socketcan control in an application the last 
> >>>> days and
> >>>> spent quite a lot of time getting clear how to deal with the netlink 
> >>>> interface.
> 
> 
> Nice idea! Especially for some kind of *integrated* (GUI-based) applications.
> 

That's what I had in mind as I started this.

> 
> >>>> int scan_set_bitrate(const char *name, __u32 bitrate);
> >>>> int scan_set_restart_ms(const char *name, __u32 restart_ms);
> >>>> int scan_set_ctrlmode(const char *name, __u32 mode, __u32 flags);
> >>>>
> >>>> int scan_get_state(const char *name, int *state);
> >>>> int scan_get_restart_ms(const char *name, __u32 *restart_ms);
> >>>> int scan_get_bittiming(const char *name, struct can_bittiming *bt);
> >>>> int scan_get_ctrlmode(const char *name, struct can_ctrlmode *cm);
> 
> 
> I'm not really happy with the 'scan_' prefix ...
> 
> I assume it's derived from s(ocket)can, and not from scan(ner) right? ;-)
> 
> What about 'canhw_' ??
> 
> Like this:
> 
> >>>> int canhw_set_bitrate(const char *name, __u32 bitrate);
> >>>> int canhw_set_restart_ms(const char *name, __u32 restart_ms);
> >>>> int canhw_set_ctrlmode(const char *name, __u32 mode, __u32 flags);
> >>>>
> >>>> int canhw_get_state(const char *name, int *state);
> >>>> int canhw_get_restart_ms(const char *name, __u32 *restart_ms);
> >>>> int canhw_get_bittiming(const char *name, struct can_bittiming *bt);
> >>>> int canhw_get_ctrlmode(const char *name, struct can_ctrlmode *cm);
> 
> This leads also to 'libcanhw' as library name.
> 
> "SocketCAN" and "Netlink" is just state-of-the-art for CAN hardware in Linux.
> No need to put it into the library name ...
> 

interesting idea. I'll think about this.

> IMHO there's also no real benefit to put this lib together with the helpers in
> 
>    trunk/can-utils/lib.[ch]
> 
> These are addressing different topics.
> 

I personally don't have opinions on this. The canconfig tool is partly
supposed to demonstrate the usage of the library too. Intergrate the lib
into the canutils package would work the same, as long as the library is
build as dyn. so and can be loaded separatedly.

> 
> > Well, yes, I should add some more lines to Documentation/can.txt.
> > Also, keep it simple having in mind that it's especially useful on
> > embedded system (the busybox's "ip" utility does not yet support CAN).
> 
> 
> Which should be fixed inside busybox :-)
> Fortunately ptxdist allows the iproute2 package to be build instead of using
> the built-in 'ip' from busybox.
> 
> 
> Regards,
> Oliver
> 
> ps. Did you recognize the updated can_if script in
> 
> http://svn.berlios.de/svnroot/repos/socketcan/trunk/etc/can_if
> 
> that can deal with the new 'ip' tool also?
> 
> # The syntax for the CAN devices is: devna...@bitrate][,restart-ms]
> # example CAN_IF="can0 c...@500000 c...@500000,200 can3,500"
> 
> Just another idea.
> 

Yeah I know the script. Indeed I looked into it every time I was
wondering for how the ip parameter should look like. ;-) The script is
nice to bring up/turn down or reload the interfaces, but the
possibilities are limited,Besides there're some natural limitations in
the iproute tool, as I mentioned in the last mail, and not at least the
big footprint and complex infrastructure. So I think canconfig comes in
quite some occassions more handy than iproute + script.

cheers
Fu
-- 
Pengutronix e.K.                           | Dipl.-Ing. Luotao Fu        |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to