![](/images/new-backgrounds/1300968/300968113x1.webp)
|
|
| 6 F 3 B 0 3 6 2 |
|
|
| |
| /* Set the data count. | */ | |
idat = DATASIZ ; | /* Register read data length. */ | ||
sprintf( &csnd[ strlen( csnd ) ], "%02d", idat ) ; |
| ||
sprintf( &csnd[ strlen( csnd )], ")¥r" ) ; |
| ||
isndsiz = strlen(csnd) ;/* Set up the data transmission length. | |||
*/ |
|
|
|
| /* Send the register read command. | ||
*/ |
|
|
|
ists = sendto( Isdp, csnd, isndsiz, 0, |
| ||
(struct sockaddr *)&Snd,sizeof( Snd ) ); | |||
if( ists == isndsiz ){ |
|
|
|
| /* Set the BIT initial value. */ | ||
memset(&ibits,0x00,sizeof(fd_set)); |
| ||
timeout.tv_sec = RECVTOUT; | /* Set the timeout time. */ | ||
|
| /* BIT setup | */ |
FD_SET(Isdp,&ibits);
ists = select( 1, &ibits,0,0,
(struct timeval *)&timeout);
if(ists <= 0){ /* If timeout and error: */ return(
}
|
| /* | Register read | response reception | */ |
ists | = recvfrom( | Isdp, | crcv, sizeof( | crcv ), 0 |
|
| ,(struct sockaddr *)&Rcv, &ircvsiz) ; |
| |||
if ( | ists > 5 ){ |
|
|
|
|
if( crcv[ 6 ] | == 'C' && crcv[ 7 ] | == 'E' ){ |
| ||
| iret = | /* | Register read | response error | */ |
} |
|
|
|
|
|
else{ | /* | Register read | response was normal. */ | ||
| iret = 0 ; |
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}
}
}
}
return( iret ) ;
}