Discussion:
[Rtai] strange return value
Felix Frey
2018-08-21 14:58:33 UTC
Permalink
Hi,

I try to receive a single byte from a mailbox with a certain timeout using
the function "rt_mbx_receive_timed".
In case of a timeout I expect the number of not received bytes as the
return value (according to documentation).

However, what I get is 0x3fffff03.
Strange....can someone explain?

Felix

PS: using RTAI 5.0 with Kernel 3.18.22
Paolo Mantegazza
2018-08-22 19:57:41 UTC
Permalink
RTE_TIMOUT, look at rtai_sched.h.
Paolo
________________________________________
From: Rtai [rtai-***@rtai.org] on behalf of Felix Frey [***@stettbacher.ch]
Sent: Tuesday, August 21, 2018 4:58 PM
To: ***@rtai.org
Subject: [Rtai] strange return value

Hi,

I try to receive a single byte from a mailbox with a certain timeout using
the function "rt_mbx_receive_timed".
In case of a timeout I expect the number of not received bytes as the
return value (according to documentation).

However, what I get is 0x3fffff03.
Strange....can someone explain?

Felix

PS: using RTAI 5.0 with Kernel 3.18.22
Felix Frey
2018-08-24 10:23:45 UTC
Permalink
Ok, got it. It tells me that there was a timeout.
So, how can I figure out now, how many bytes were received until the timeout occured,
in case I tried to receive more than one byte?

Felix

> RTE_TIMOUT, look at rtai_sched.h.
> Paolo
> ________________________________________
> From: Rtai [rtai-***@rtai.org] on behalf of Felix Frey [***@stettbacher.ch]
> Sent: Tuesday, August 21, 2018 4:58 PM
> To: ***@rtai.org
> Subject: [Rtai] strange return value
>
> Hi,
>
> I try to receive a single byte from a mailbox with a certain timeout using
> the function "rt_mbx_receive_timed".
> In case of a timeout I expect the number of not received bytes as the
> return value (according to documentation).
>
> However, what I get is 0x3fffff03.
> Strange....can someone explain?
>
> Felix
>
> PS: using RTAI 5.0 with Kernel 3.18.22
> _______________________________________________
> Rtai mailing list
> ***@rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
Paolo Mantegazza
2018-08-24 20:20:06 UTC
Permalink
As soon as your mbx gets a byte the timeout condition is nulled.
So if you are not returned the value we talked about then if you get a zero, you received the number of bytes you wanted, otherwise a positive number will tell you you missed that number of bytes.

Paolo

________________________________________
From: Rtai [rtai-***@rtai.org] on behalf of Felix Frey [***@stettbacher.ch]
Sent: Friday, August 24, 2018 12:23 PM
To: ***@rtai.org
Subject: Re: [Rtai] strange return value

Ok, got it. It tells me that there was a timeout.
So, how can I figure out now, how many bytes were received until the timeout occured,
in case I tried to receive more than one byte?

Felix

> RTE_TIMOUT, look at rtai_sched.h.
> Paolo
> ________________________________________
> From: Rtai [rtai-***@rtai.org] on behalf of Felix Frey [***@stettbacher.ch]
> Sent: Tuesday, August 21, 2018 4:58 PM
> To: ***@rtai.org
> Subject: [Rtai] strange return value
>
> Hi,
>
> I try to receive a single byte from a mailbox with a certain timeout using
> the function "rt_mbx_receive_timed".
> In case of a timeout I expect the number of not received bytes as the
> return value (according to documentation).
>
> However, what I get is 0x3fffff03.
> Strange....can someone explain?
>
> Felix
>
> PS: using RTAI 5.0 with Kernel 3.18.22
> _______________________________________________
> Rtai mailing list
> ***@rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
Continue reading on narkive:
Loading...