Hi Vlasdiv,

On Wed, Nov 25, 2009 at 06:30:07PM +0100, [email protected] wrote:
> Hi,
> very nice idea!
> 
> The SocketCAN version of our IXXAT CANopen Stack SW is currently
> compatible 
> to the SysFS version. We need however to set CAN up and down directly 
> from the Stack, not using the ifconfig. So I was forced to implement 
> corresponding ioctl calls with IFF_UP etc. And netlink interface is 
> quite more complex, if you cannon use "ip" and need to make CAN control 
> stuff directly from your SW (I know, that is not UNIX-way, that's
> life)...
> 

there're actually if_up/down callbacks in the lib, which also uses
netlink interface and awaits only the name of the device as parameter.
It's however used as static internally for now, since it's not strict
can-relevant. I think there'd be other libraries in the wild, which
simply do if_up/down stuff, didn't check though.

> Such a user space component can make things really easier for me, as a 
> CANopen SW maintainer under SocketCAN. If I can use someuser space
> library
> "libsocketcan" to:
> 
> - start/stop CAN

yeah, start with
scan_do_restart(const char* name)
stop alias driving down the interface is there but used as static, I'll
make a wrapper with proper name for this.

> - set bitrate

yes.
scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
(sample point is optional)
or
scan_set_bittiming(const char *name, struct can_timing *bt)
to use the expert mode.

> - recover from bus-off

yes,
scan_set_restart_ms(const char *name, __u32 restart_ms)
can set/disable the bus-off autorecovery.

> - ???
>
set/get control mode. get state/clockfrequency etc.

cheers
Luotao 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