6 F 3 B 0 3 6 2

/* SLW */ /**********************************************************************/

/*

 

 

 

 

*/

/*

cl_send - Register read/write processing

*/

/*

 

 

 

 

*/

/**********************************************************************/

/*

 

 

 

 

*/

/*

Calling sequence

 

 

*/

/*

 

 

 

 

*/

/*

cl_send();

 

 

*/

/*

 

 

 

 

*/

/* Arguments: Isdp

: int

I

: socket identifier

*/

/*

 

 

 

 

*/

/*

ists

: int

O

: return status

*/

/*

 

 

 

 

*/

/**********************************************************************/

int cl_send( int Isdp )

 

 

 

 

{

 

 

 

 

 

 

int

j, k

;

 

/*

Loop counter

*/

int

ists = 0 ;

 

/*

Return status

*/

int

iret

;

 

/*

Return status

*/

int

ircvsiz

;

 

/*

Reception data length */

int

isndsiz

;

 

/*

Data length

*/

int

icunt

;

 

/*

Data setup index

*/

int

idat

;

 

/*

Temporary

*/

char

csnd[ 1000 ] ;

 

/*

Data send buffer

*/

char

crcv[ 1000 ] ;

 

/*

Data receive buffer

*/

fd_set ibits;

 

 

/*

SELECT() bit mask

*/

struct timeval timeout;

/*

SELECT() timer value

*/

struct

sockaddr_in

Snd, Rcv;

 

 

 

iret = -1 ;

 

 

 

 

 

memset( &Snd, 0x00, sizeof( Snd ) );

 

 

memset( &Rcv, 0x00, sizeof( Rcv ) );

 

 

memset( csnd, 0x00, sizeof( csnd ) );

/* Clear the send data buffer.

*/

 

 

 

 

 

 

memset( crcv, 0x00, sizeof( crcv ) );

/* Clear the receive data buffer.

*/

 

 

 

 

 

 

 

 

 

 

/*

Set up the register write send data.

*/

 

 

 

 

 

 

sprintf( &csnd[ 0 ], "(A01DW" ) ; /*

Set up the register write command.

*/

 

 

 

 

 

 

 

 

 

 

/*

Set the starting register number.

*/

 

 

 

 

 

 

sprintf( &csnd[ strlen(csnd)], "%s",

REG_TYPE );

 

sprintf( &csnd[ strlen(csnd) ], "%04s", REG_ADR );

 

sprintf( &csnd[ strlen( csnd) ], ","

) ;

 

idat = DATASIZ ;

 

/*

Set the data count. */

 

54

Page 55
Image 55
Toshiba T2N instruction manual ⎯ 54 ⎯