Re: [Svxlink-devel] Question abt FdWatch
Brought to you by:
sm0svx
From: SM0SVX <sm...@us...> - 2014-04-26 13:24:11
|
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 |