roland Tollenaar wrote:
 > >
 > > And follow the links, you will arrive at:
 > > http://www.xenomai.org/documentation/trunk/html/api/group__rtcan.html
 > 
 > Actually this is where I had been spending most of my time before
 > posting my mail.
 > 
 > I must be blind because I really do not see anything remotely
 > resembling functions like:
 > 
 > rt_dev_ioctl(arg1, arg2, and maybe arg 3 don;t know off by heart anymore)
 > 
 > Are you sure the above is the link I must look at?

Yes, Ok, you need a bit of knowledge of how ioctl works. The first
argument is the socket/file descriptor, the second argument is a
command, and the third argument an argument to that command.

The commands are those listed in the section entitled "IOCTLs". Now, if
you read:
#define SIOCGIFINDEX   _IOWR(RTIOC_TYPE_CAN, 0x00, struct ifreq)

You are supposed to understand that SIOCGIFINDEX is a valid command,
that the argument of this command is a pointer to a "struct ifreq", and
that this command reads and writes to this structure. Since the text
below this define is "Get CAN interface index by name", you should
understand that you have to use it that way:

struct ifreq ir;
ir.ifr_name = "rtcan0";
rt_dev_ioctl(socket, SIOCGIFINDEX, &ir);
index = ir.ifr_ifindex;

-- 


                                            Gilles Chanteperdrix.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to