User Manual

SDK - SCR API
________________________________
____________
Boomer II User Manual & Integrator’s Guide
Wavenet Technology 70 BM210012WT09
q scr_EncodeLogin()
Prototype:
int scr_EncodeLogin(byte *l_buf, char *l_hostid, char *l_passwd)
Description
For DataTAC
®
5000 Networks Only. This function is used to encode
the RNG login packet that is sent to the RNG when the connection is
first established.
Input:
Ø *l_buf The buffer for the encoded login packet to be returned in. When
calling this function, this parameter must point to an allocated
buffer of at least SCR_MAX_LEN bytes.
Ø *l_hostid The DataTAC host login or host id
Ø *l_passwd The DataTAC host password
Output:
× Return value = 0 Operation failed. The Network Type is not set to DataTAC 5000.
× Return value < 0 Operation failed. Value SCR_ERROR is returned to indicate an
error
× Return value > 0 Operation was successful and the number of bytes is returned in
l_buf.
Example
#i n c l ude <s c r a p i . h >
{
by t e l buf f e r [ SCR_MAX_LEN] ; / *buf f e r f o r SCR l ogi n
pa c ke t * /
i nt l l e n; / *l e ng t h of SCR l o gi n pa c ke t */
. . .
x2 5 c a l l ( . . . ) ; / *ma k e t he c on ne c t i o n t o t h e RNG*/
l l e n = s c r _ Enc o de Logi n ( b u f f e r , ' LOGI N' , ' PASSWORD' ) ;
i f ( l l e n == SCR_ERROR) {
/ *r e po r t a n e r r o r * /
. . .
}
e l s e i f ( l l e n > 0 ) { / * f o r non - Da t a TAC 50 0 0 ne t wor k s , ' /
/ *l l e n wi l l be z e r o, s o we d o n o t
*/
/ *n e e d t o s e n d t he l og i n me s s a g e .
*/
/ * For Da t a TAC S0 00, s e nd e n c od e d l og i n me s s a g e t o RNG
*/
x2 5 _s e nd( . . . [ bu f f e r , l i e n, . . . )
}
. . .
}