...
Set the function which will be called when an event is received by the host code:
LINE_SET_INCOMING_CMD_FUNC(lp, t4TimerProcessEvent);
The following is the function which is called when any event is received by the host code. The function will check for the T4 timer event.
...
void
...
t4TimerProcessEvent(BTLINE
...
*lp,
...
struct
...
args_packet
...
*args)
...
{
...
struct
...
args_fax
...
args_fax;
...
unsigned
...
t4TimerValue;
...
unsigned
...
t4Duration;
...
unsigned
...
t4Attempt;
...
...
unsigned t4Timeout;
//
...
Check
...
to
...
see
...
if
...
the
...
event
...
received
...
is
...
from
...
the
...
fax
...
facility
...
and
...
is
...
the
...
//
...
T4
...
adaptation
...
information
...
event.
...
if
...
((args->facility
...
==
...
MILL_FACILITY_FAX)
...
&&
...
(args->cmd_verb
...
==
...
MILL_VERB_EVENT)
...
&&
...
(args->cmd_specifier
...
==
...
FAX_T4_ADAPT_INFO_EVENT))
...
{
...
//
...
Obtain
...
the
...
current
...
T4
...
timer
...
value,
...
the
...
T4
...
duration
...
to
...
receive
...
//
...
a
...
response
...
or
...
T4
...
time
...
out
...
, the T4 attempt and
...
the
...
T4
...
timeout indication.
...
BT_ZERO(args_fax);
...
BfvFaxT4TimerParams(lp,
...
&args_fax);
...
t4TimerValue
...
=
...
args_fax.t4TimerValue;
...
t4Duration
...
=
...
args_fax.t4Duration;
...
t4Attempt
...
=
...
args_fax.t4Attempt
...
;
t4Timeout = args_fax.t4Timeout;
printf("t4TimerProcessEvent
...
: attempt %u duration %u T4TimerValue %u timeout %u\n",
...
args_fax.
...
t4Attempt,
...
args_fax.t4Duration,
args_fax.t4TimerValue,
...
args_fax.
...
t4Timeout
);
...
...
//
...
Set
...
the
...
T4
...
timer
...
value
...
to
...
a
...
new
...
value.
...
For
...
example,
...
the
...
following
...
//
...
checks
...
to
...
see
...
if
...
the
...
attempt
...
just
...
completed
...
is
...
1
...
and
...
if
...
so
...
, it
...
will
...
set
...
the
...
//
...
T4
...
timer
...
value
...
to
...
the
...
existing
...
T4
...
timer
...
value
...
plus
...
500
...
ms.
...
//
...
The end user
...
can
...
change
...
the
...
following
...
to
...
set
...
the
...
T4
...
timer
...
value
...
to
...
a
...
new
...
//
...
value
...
according
...
to
...
some
...
algorithm
...
determined
...
by
...
the
...
end
...
user
...
if
...
(t4Attempt
...
==
...
1)
...
{
...
BT_ZERO(args_fax);
...
args_fax.t4TimerValue
...
=
...
t4TimerValue
...
+
...
500;
...
...
printf("t4TimerProcessEvent
...
: Set
...
T4TimerValue
...
%u\n",
...
args_fax.t4TimerValue
...
);
...
...
BfvFaxT4TimerParams(lp,
...
&args_fax);
...
}
...
}
...
}
Product Areas Affected
- This feature will affect the T4 timer operation in a fax session if the keyword t4_timer_mode is set to 2.
...
Backward Propagation Release(s)
None
Risks
None