Skip navigation.
Home
The QNX Community Portal

View topic - how do i append text to a multi line.

how do i append text to a multi line.

Discussion about the QNX6 OS.

how do i append text to a multi line.

Postby rafae11@yahoo.com » Mon Jul 01, 2013 1:45 pm

I have a timer that loops forever. i want to log the results in a multiline.
how do i append data to the multiline?
do i have to keep copying the data out of it and then post it back?

Code: Select all
void*  function( void*  arg )
{
   struct timespec start;
         struct sigevent         event;
         struct itimerspec       itime;
         timer_t                 timer_id;
         int                     chid;
         int                     rcvid;
         my_message_t            msg;

         chid = ChannelCreate(0);

         event.sigev_notify = SIGEV_PULSE;
         event.sigev_coid = ConnectAttach(ND_LOCAL_NODE, 0,chid,_NTO_SIDE_CHANNEL, 0);
         event.sigev_priority = getprio(0);
         event.sigev_code = MY_PULSE_CODE;
         timer_create(CLOCK_REALTIME, &event, &timer_id);

         itime.it_value.tv_sec = 1;
         //itime.it_value.tv_nsec = 500000000;
         itime.it_interval.tv_sec = 1;
         //itime.it_interval.tv_nsec = 500000000;
         timer_settime(timer_id, 0, &itime, NULL);

         int      enter_result;   // Resulting of entering the Photon library lock

         char *text="we got a pulse from our timer\n";
         PtArg_t args[1];
         PtSetArg(&args[0], Pt_ARG_TEXT_STRING, text, 0);

         while(quit == 'n')
         {
             rcvid = MsgReceive(chid, &msg, sizeof(msg), NULL);
             if (rcvid == 0) { /* we got a pulse */
                  if (msg.pulse.code == MY_PULSE_CODE)
                  {
                     PtEnter(0);
                     PtSetResources(ABW_output, 1, args);
                     PtLeave(0);

                      clock_gettime(CLOCK_REALTIME, &start);
                      printf("%d\n",start.tv_sec);
                  } /* else other pulses ... */
             } /* else other messages ... */

         }
   return( 0 );
}
rafae11@yahoo.com
New Member
 
Posts: 6
Joined: Mon Jul 01, 2013 1:40 pm

Re: how do i append text to a multi line.

Postby Tim » Mon Jul 01, 2013 4:00 pm

Rafaell,

What do you mean by multiline. I don't understand what you want to do.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: how do i append text to a multi line.

Postby maschoen » Mon Jul 01, 2013 5:09 pm

maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: how do i append text to a multi line.

Postby rafae11@yahoo.com » Mon Jul 01, 2013 9:29 pm

thanks maschoen that is what i needed.
rafae11@yahoo.com
New Member
 
Posts: 6
Joined: Mon Jul 01, 2013 1:40 pm


Return to QNX6 - OS

Who is online

Users browsing this forum: No registered users and 4 guests