Hi everybody,
I try to learn Xenomai. I have a problem that I do not understand. I want that my real time task to communicate with my user space task through a pipe (FIFO) in order to save sample datas in a file. My problem is the following. I create a pipe with:
err = rt_pipe_create(&pipe1,"MyPipe1",1,FIFO_SIZE_PARAM*sizeof(double));
if(err)
{
printf("pipe MyPipe1 creation failure : %d\n",err);
}
then in the real time task i write to the pipe like this:
err = rt_pipe_stream(&pipe1,&tension0,sizeof(double)); // i already try rt_pipe_write but i got the same result
if ( err < 0 )
{
printf("rt_pipe_write erreur %d \n",err);
}
On the user side, i am doing the following :
double tabTest[FIFO_SIZE_PARAM];
int nb_read;
nb_read=read(pipe1user,tabTest,FIFO_SIZE_PARAM*sizeof(double));
printf("I got %d bytes\n",nb_read);
I get a value of 8 for nb_read which corresponds to sizeof(double). But i am expecting more. I do not know why the system function read(2) works like this.
Thank you in advance for your help,
Mathieu