* Re: [Xenomai-help] can getstate
2007-03-02 10:59 [Xenomai-help] can getstate Stéphane ANCELOT
@ 2007-03-02 10:05 ` Jan Kiszka
2007-03-02 10:44 ` Wolfgang Grandegger
1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2007-03-02 10:05 UTC (permalink / raw)
To: Stéphane ANCELOT; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 300 bytes --]
Stéphane ANCELOT wrote:
> Hi,
> Can somebody provide me with a programming example on how to retrieve
> state using rt_dev_ioctl .
What state? The state of a CAN controller, ie. the following IOCTL?
http://www.rts.uni-hannover.de/xenomai/lxr/source/include/rtdm/rtcan.h?a=i386#824
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] can getstate
2007-03-02 10:59 [Xenomai-help] can getstate Stéphane ANCELOT
2007-03-02 10:05 ` Jan Kiszka
@ 2007-03-02 10:44 ` Wolfgang Grandegger
2007-03-02 16:22 ` Stéphane ANCELOT
1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2007-03-02 10:44 UTC (permalink / raw)
To: Stéphane ANCELOT; +Cc: xenomai
Stéphane ANCELOT wrote:
> Hi,
> Can somebody provide me with a programming example on how to retrieve
> state using rt_dev_ioctl .
The following (untested) code snippet should work:
struct ifreq ifr;
can_state_t *pstate;
...
pstate = (can_state_t *)&ifr.ifr_ifru;
ret = rt_dev_ioctl(fd, SIOCGCANSTATE, &ifr);
if (ret) {
perror("rt_dev_ioctl");
return;
}
printf("Current state = %d\n", *pstate);
RT-Socket-CAN allows a very flexible error handling. Please have a look
to
http://www.xenomai.org/documentation/trunk/html/api/group__rtcan.html#g451ba35aa4d0bef48cb7b0416f5b4367
Wolfgang,
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Xenomai-help] can getstate
@ 2007-03-02 10:59 Stéphane ANCELOT
2007-03-02 10:05 ` Jan Kiszka
2007-03-02 10:44 ` Wolfgang Grandegger
0 siblings, 2 replies; 4+ messages in thread
From: Stéphane ANCELOT @ 2007-03-02 10:59 UTC (permalink / raw)
To: xenomai
Hi,
Can somebody provide me with a programming example on how to retrieve
state using rt_dev_ioctl .
Best Regards
thanks
steph
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] can getstate
2007-03-02 10:44 ` Wolfgang Grandegger
@ 2007-03-02 16:22 ` Stéphane ANCELOT
0 siblings, 0 replies; 4+ messages in thread
From: Stéphane ANCELOT @ 2007-03-02 16:22 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai
yes, it rocks, thanks
Wolfgang Grandegger wrote:
> Stéphane ANCELOT wrote:
>> Hi,
>> Can somebody provide me with a programming example on how to retrieve
>> state using rt_dev_ioctl .
>
> The following (untested) code snippet should work:
>
> struct ifreq ifr;
> can_state_t *pstate;
> ...
> pstate = (can_state_t *)&ifr.ifr_ifru;
> ret = rt_dev_ioctl(fd, SIOCGCANSTATE, &ifr);
> if (ret) {
> perror("rt_dev_ioctl");
> return;
> }
> printf("Current state = %d\n", *pstate);
>
> RT-Socket-CAN allows a very flexible error handling. Please have a look
> to
> http://www.xenomai.org/documentation/trunk/html/api/group__rtcan.html#g451ba35aa4d0bef48cb7b0416f5b4367
>
>
> Wolfgang,
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-02 16:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-02 10:59 [Xenomai-help] can getstate Stéphane ANCELOT
2007-03-02 10:05 ` Jan Kiszka
2007-03-02 10:44 ` Wolfgang Grandegger
2007-03-02 16:22 ` Stéphane ANCELOT
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.