Menu system with vgetty
Jan Kasprzak (kas@informatics.muni.cz)
Tue, 8 Jun 1999 12:09:33 +0200
Replying to my own post; I wrote:
: Nick Phillips wrote:
: : After a DTMF has been received, you will usually get a "READY". However, if
: : someone keys two tones in quick succession, you will get another
: : "RECEIVED_DTMF" first.
:
: I have not been able to verify this.
Well, I have verified this now, but I am not sure what to do with
it - in Modem::Vgetty I used the "READY" message as a way of communicating
between the main program and the event handler. Typically, main program
registered an event handler for some event (RECEIVED_DTMF, BUSY_TONE etc),
called PLAY <message> or WAIT <seconds>, and waiting for READY.
When the event arrived, the handler can either restart the WAIT (or even
PLAY), let it continue, or as the third alternative call STOP and return,
which cause that the main program gets READY immediately.
But when vgetty does not reply "READY" to the "STOP" message
immediately, and queues another RECEIVED_DTMF event first, I cannot
tell the main program to unregister this event handler and possibly
register another one. So two subsequent DTMF tones cannot be safely
handled by two different event handlers.
I can see two possible solutions: The first one is to modify
vgetty to reply to the commands (such as "STOP") first, and then sending
the events from the queue, or to add some generic mechanism for
Modem::Vgetty's event handlers to communicate with the main program.
We can do it for example using the event handler's return value (which
is currently ignored). For example, the event handler can return
either the "undef" value, which will work the same way as it works now,
or a string (e.g. "READY"), which will then be returned to the
main program, and (maybe) the next "READY" from the vgetty will be
discarded.
What do you think about it?
-Yenya
--
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz> http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz 0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\ Czech Linux Homepage: http://www.linux.cz/ ///
|||| > Where do the -- MARK --s come from ? ||||
|||| It is the sound of Tux the penguin chewing on your system logs. ||||