Hi Fu, Luotao Fu wrote: > 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.
Hm, the name "restart" is somehow reserved for bus-off recovery. Even if the name is not well chosen, we should use another name for down/up, e.g. scan_do_down_up() to make that clear, if we need that at all. Or have I missed something? >> - 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. And for manual recovery? See my comments above. Wolfgang. _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
