From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45E6B9D7.2000000@domain.hid> Date: Thu, 01 Mar 2007 12:32:39 +0100 From: Wolfgang Grandegger MIME-Version: 1.0 Subject: Re: [Xenomai-help] CAN rt_dev_recvfrom References: <45E5ED29.8070505@domain.hid> <45E6B77A.5030600@domain.hid> In-Reply-To: <45E6B77A.5030600@domain.hid> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: rolandtollenaar@domain.hid Cc: Xenomai-help@domain.hid Roland Tollenaar wrote: > Hi Wolfgang, > >>> Can this be confirmed or is rt_dev_recvfrom() behaving incorrectly in >>> my case? >> >> rt_dev_recvfrom() reads message frames (one at a time) from an >> internal socket buffer (there is actually a kernel configuration >> option to configure the size). If no messages are available, it will >> block by default, but it can also be used in non-blocking mode by >> using the flag MSG_DONTWAIT. It seems, that your application is trying >> to read messages periodically in polling mode. Either you do reading >> and buffering in your own thread as you suggested above or you use >> rt_dev_recvfrom() in non-blocking mode. > > Thanks for this. I have not tried it yet but I was looking for that flag > in the hope that something like this would exist. I thought I had seen > something like it but when I tried to locate it yesterday I failed. > Don;t worry it is there, I just checked. Sorry. > > Where can I find the buffer size option in the kernel config menu? What > is the default size? On the first menu of the RT-Socket-CAN configuration options: config XENO_DRIVERS_CAN_RXBUF_SIZE depends on XENO_DRIVERS_CAN int "Size of receive ring buffers (must be 2^N)" default 1024 Note that the messages are stored in "packed" format. Wolfgang.