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.


>>>> 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 ...

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.


> 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.

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

Reply via email to