On Wednesday 30 April 2014 08:11:59 Adi Bier wrote:
> Hi Tobias,
> I've created a branch for the FdWatch extension. I've changed the source
> code according to the hints but here (Ubuntu 11.x) it has still the same
> effect (no registration of incoming characters).
> So I hope if we looking together on it we will find a way to make it
Please look at my example again. You are still watching the slave fd instead
of the master fd. You should not open the slave fd in SvxLink. That's the
other end of the PTY which the external handling script should open to inject
detected DTMF digits.
You are also calling grantpt and unlockpt twice. I don't know if that can
cause any harm but it's unnecessary anyway.
73's de SM0SVX / Tobias
> vy 73's de Adi, DL1HRC
> Am 26.04.2014 15:24, schrieb SM0SVX:
> > On Friday 25 April 2014 20:05:10 Adi Bier wrote:
> >> Am 25.04.2014 10:44, schrieb Rob Janssen:
> >>> Adi Bier wrote:
> >>>> My problem is that the watcher function doesn't register incoming
> >>>> characters sent by a script to /tmp/dtmf so I guess that symlinks
> >>>> aren't
> >>>> supported at the moment by FdWatch? FdWatch with STDIN is used in the
> >>>> project and working well.
> >>>> Thank's for a hint.
> >>> Did you configure the pty to actually return data in the format that you
> >>> use? (termios settings that return either single charcters, use a
> >>> timeout, or whatever) By default the pty will likely be in line mode and
> >>> will not pass individual characters.
> >>> Rob
> >> Hi Rob
> >> thank you for this info, I think I have to play a bit with ioctl.
> > If I understand your email correctly, the problem is rather that you are
> > trying to use the slave device from svxlink. That should be opened by the
> > external script. The master end of the PTY should be used inside of
> > svxlink.>
> > To create a new PTY:
> > int master_fd = posix_openpt(O_RDONLY|O_NOCTTY);
> > grantpt(master_fd);
> > unlockpt(master_fd);
> > Watch that:
> > FdWatch *watch = new FdWatch(master_fd, FdWatch::FD_WATCH_RD);
> > watch->activity.connect(...);
> > Create symlink:
> > char *slave = ptsname(master_fd);
> > symlink(slave, "/tmp/dtmf");
> > Now you should be able to open the slave device using /tmp/dtmf from the
> > script and write chars to it.
> > 73's de SM0SVX / Tobias
> >> 73's de Adi, DL1HRC