All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu JOINIE-MAURIN <mjoiniem@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] Problem with rt_pipe and user space communication
Date: Wed, 18 Jul 2007 14:43:22 +0000 (GMT)	[thread overview]
Message-ID: <314537.73250.qm@domain.hid> (raw)

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

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




      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

[-- Attachment #2: Type: text/html, Size: 1822 bytes --]

             reply	other threads:[~2007-07-18 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 14:43 Mathieu JOINIE-MAURIN [this message]
2007-07-18 17:48 ` [Xenomai-help] Problem with rt_pipe and user space communication Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=314537.73250.qm@domain.hid \
    --to=mjoiniem@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.