User's Manual

Table Of Contents
Boomer II User Manual & Integrator’s Guide ______________________________________________ SDK SCRAPI
BM210012WT27 161 Wavenet Technology
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
#include <scrapi.h>
{
SCRMsg lmsg; /* SCR message struct */
char *lreason; /* reason code string */
. . .
/* receive a message and decode it into lmsg */
. . .
if (lmsg.msg_type == SCR_ACK) {
lreason =
scr_NakReasonText(lmsg.u.ack.response_code)
if (lreason == (char *)NULL) {
printf(“Successful delivery of message\n”);
}
else {
printf(“Failed delivery to LLI %08X -
reason ‘%s'\n", lmsg.u.ack.lli, lreason);
}
}
}