Hallo Jan xenomai-2.2.0, rtnet-0.9.3-svn
I have included the following lines in frag-ip.c (for user mode). ----------------------------------------------------- int fd; rt_task_set_periodic(NULL, TM_NOW, CYCLE); fdtdma = rt_dev_open("TDMA0", O_RDONLY); if (fdtdma < 0) { printf("TDMA open failed!\n"); } ret = rt_dev_ioctl(fdtdma, RTMAC_RTIOC_WAITONCYCLE, TDMA_WAIT_ON_SYNC); if (ret < 0 ) { printf("RTMAC_WAITONCYCLE failed"); } printf("after WAITONCYCLE\n"); -------------------------------------------- The problem is now that the process seems to hang in rt_dev_ioctl() forever. "after WAITONCYCLE" is never printed. A bug? Jochen >From: Jan Kiszka <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >CC: rtnet-users@lists.sourceforge.net >Subject: Re: [RTnet-users] WAITONCYCLE User Mode >Date: Mon, 07 Aug 2006 14:23:05 +0200 > >matrix_df hotmail wrote: > > Hello > > > > Is there any example which shows how to use WAITONCYCLE in user mode? > > Or some kind of documention? > > > > I tried to copy it from /broken/netshm but this is kernel mode and I >did > > not get very far. > > > > int rtmac; > > char rtmac_name[] = "TDMA0"; > > struct rtdm_getcontext_args getcontext; > > > > rtmac = open_rt(rtmac_name, O_RDONLY); > > if (rtmac < 0) { > > ret = rtmac; > > //goto err_rtmac1; > > printf("rtmac open failed!\n"); > > } > > --> NOW compiling problem > > getcontext.struct_version = RTDM_CONTEXT_STRUCT_VER; > > ret = ioctl_rt(rtmac, RTIOC_GETCONTEXT, &getcontext); > > if (ret < 0) { > > printf("rtmac RTIOC_GETCONTEXT failed!\n"); > > } > >RTIOC_GETCONTEXT is a short path opener, only available to kernel-space >users (see also RTDM documentation). Therefore the compilation problems. > > >To invoke WAITONCYLE/WAITONCYLE_EX (see also stack/include/rtmac.h), >simply open the related TDMA device > >fd = rt_dev_open("TDMA0", O_RDWR); > >and issue RTMAC_RTIOC_WAITONCYCLE or RTMAC_RTIOC_WAITONCYCLE_EX from >your RT-thread: > >err = rt_dev_ioctl(fd, RTMAC_RTIOC_WAITONCYCLE, TDMA_WAIT_ON_SYNC); > >-or- > >struct rtmac_waitinfo waitinfo = { > type: TDMA_WAIT_ON_SYNC, > ext_size: 0 >}; > >err = rt_dev_ioctl(fd, RTMAC_RTIOC_WAITONCYCLE_EX, &waitinfo); >/* cycle number is now in waitinfo.cycle_no */ > > >If you happen to create a nice demo with this information, please >contribute it so that we can put it into the examples repository. > >Jan > ><< signature.asc >> ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users