User Manual

SDK - SCR API
________________________________
____________
Boomer II User Manual & Integrator’s Guide
Wavenet Technology 74 BM210012WT09
q scr_NakReasonText()
Prototype:
char *scr_NakReasonText(char *l_reason_code)
Description
This routine converts a response code from an HC or AB message into
a text string describing that code. The returned pointer is a pointer to a
static text string within the library. This string must not be overwritten
or freed. This string pointer will stay valid for the duration of the
program's execution. The text strings correspond to the text given in
the DataTAC 5000 System Host Application Programmer's Manual.
This routine can also be used to perform a network independent test for
successful delivery by checking for a NULL return value from this
function.
Input:
Ø *l_reason code The response code from the Ack/AB/HC message.
Output:
× Return NULL Operation successful delivery of the message.
× Return !NULL Operation failed. Value a char pointer to a text string buffer
containing an English description for the meaning of the given
response code.
Example
#i n c l ude <s c r a p i . h >
{
SCRMs g l ms g; / * SCR me s s a ge s t r u c t */
c ha r * l r e a s on; / * r e a s o n c od e s t r i ng * /
. . .
/ * r e c e i ve a me s s a g e a n d d e c ode i t i nt o l ms g * /
. . .
i f ( l ms g. ms g_ t yp e == SCR_ ACK) {
l r e a s on =
s c r _ Na kRe a s on Te xt ( l ms g. u. a c k. r e s pons e _c od e )
i f ( l r e a s on == ( c ha r * ) NULL) {
pr i nt f ( Su c c e s s f u l d e l i ve r y o f me s s a g e \ n ) ;
}
e l s e {
pr i n t f ( Fa i l e d d e l i ve r y t o LLI %08 X -
r e a s on %s ' \ n " , l ms g. u . a c k . l l i , l r e a s on ) ;
}
}
}