Hi,
What I try to do is to iterate through  received() data from a pipe.
and break and printout at every '\n' (dec 10)

I've tried to do an inplementation of this in my module.c, but it
doesn't really work.
I would be grateful if anyone could give me hints about what I'm
missing or where to do look for examples that show this.

here's what I'm doing in my periodic task.

while(1){
                err = rt_task_wait_period(NULL);
                if (err) {
                        if (err != -ETIMEDOUT) {
                                printk("rt_task_wait_period() failed: code 
%d\n", err);
                                rt_task_suspend(NULL);
                        }
                        continue;
                }
                //number of bytes received
                len = rt_pipe_receive(&myPipe, &msgin, TM_INFINITE);
                printk("number of received bytes %d\n", len);
                pmyChar = P_MSGPTR(msgin);
                while(high < len){
                while(pmyChar[high]!='\n'){
                high++;
                }
                if(pmyChar[high]=='\n'){
                for(;low<high;low++){
                        printk("%d",pmyChar[low]);
                }
                 printk("\n");
                high++;
                low = high;
                }
                }
                rt_pipe_free(&myPipe,msgin);
                printk("TASK3 has ran\n");
}

The output in dmesg now is:
TASK1 has ran
TASK2 has ran
number of received bytes 13
104104101104101104101104101104TASK3 has ran

So it doesn't newline after each '\n' :(


thanks
Bachman

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to