User's Manual

Table Of Contents
Boomer II User Manual & Integrator’s Guide ______________________________________________ SDK SCRAPI
BM210012WT27 155 Wavenet Technology
int lrc;
lrc = scr_Init(SCR_DATATAC_4000);
if (lrc == SCR_ERROR) {
exit(0);
}
/* perform other SCR operations */
. . .
}
scr_Encode()
Prototype:
int scr_Encode(byte *l_buf, SCRMsg *l_msg)
Description
This routine encodes a SCRMsg structure into an SCR encoded data
buffer. This routine transparently converts and encodes IB, OB, AB,
HC, HR, and MI messages for the correct network type. For example,
if scr_Init() has been used to set the network type to DataTAC 4000,
and an MI message is passed to scr_Encode(), it will be encoded as an
OB message.
Input:
*l_buf The buffer for the encoded message to be returned in. When
calling this function, this parameter must point to an allocated
buffer of at least SCR_MAX_LEN bytes. The encoded message
is returned as a binary array. It is not a NULL terminated string.
*l_msg An SCRMsg structure representing the message to be encoded.
For a description of the SCRMsg structure, refer to "SCR
Structures.
Output:
Return value = 0 Operation was successful and the encoded message is returned
in l_buf.
Return value 0 Operation failed. Value SCR_ERROR is returned to indicate an
error
Example
#include <scrapi.h>
{
SCRMsg lmsg; /* SCR message struct */
byte ldata[200]; /* data to send to host */
byte lbuffer[SCR_MAX_LEN]; /* buffer for encoded SCR msg
*/
int llen; /* length of encoded SCR msg
*/
. . .
strcpy((char *)ldata, "Hello world")