| Here's how DECterm does it (according to your description this should result
in an infinite loop, but maybe you're doing something differently):
/*
* set_xoff_callback()
*
* This routine enables notification of xoff. Typically, such xoff notification
* would occur when typein buffer has become full.
*/
static void
set_xoff_callback( stm )
STREAM *stm;
{
IOSB iosb;
int status;
extern void p_xoff_ast();
status = sys$qiow(
0,stm->pty.chan,IO$_SETMODE,&iosb,0,0,p_xoff_ast,stm->isn,0,2,0,0);
if ( FAILED( status ) )
log_message( "can't set xoff ast, status is %x\n", status );
else if ( FAILED( iosb.status ) )
log_message( "can't set xoff ast, I/O status is %x\n",
iosb.status );
}
/*
* p_xoff_ast()
*
* Come here at ast level if xoff condition is received from pty.
* Queue up event to be handled at non-ast level.
*/
void
p_xoff_ast (isn)
ISN isn;
{
non_ast (pty_xoff, isn);
}
/*
* pty_xoff()
*
* At main non-ast level, process the xoff condition.
*
*/
static void
pty_xoff (isn)
ISN isn;
{
STREAM *stm = GetSTM (isn,"xoff");
int count;
if (stm == NULL) return; /* only necessary because of bug in pty
/* driver that causes it to deliver ast
/* even after $cancel */
if (!stm->pty.active) return;
stm->pty.write_full = TRUE;
set_xoff_callback (stm);
}
|
| Thanks for the reply Bob. Your note did shed some light on things;
however, now we get an invalid parameter everytime we try to set the
AST. Here's a sample of our code:
if ((status = SYS$QIOW (0, PTY_chan,
IO$_SETMODE, &iosb,
0, 0,
xoff_ast, offset,
0, 2, 0, 0)) != SS$_NORMAL)
db_stop(status);
The documentation sttes that the AST parameter can be a 16 bit
value and that the Xoff or Xon control character is written
back into the high order 16 bits. I'm assuming that this means
that the "offset" parameter I have above should be a longword with
the low-order 16 bits becoming the AST parameter and the high order
16 bits the indicaion of xon or xoff.
I've received the Invalid Parameter status with "offset" set to a
16 bit value, a longword value, and just 0. I noticed in your
sample code that you were using a pointer to a structure called
STREAM and that the parameter you passed to the p_xoff_ast was
stm->isn. Is there something here that we're missing?
Cheers,
Cody
|