INTEGER FUNCTION SBREAK (X) C C **************************************************************** C C KERMIT for the MODCOMP MAXIV operating system C C Compliments of: C C SETPOINT, Inc. C 10245 Brecksville Rd. C Brecksville, Ohio 44141 C C C KERMIT is a copyrighted protocol of Columbia Univ. The authors C of this version hereby grant permission to copy this software C provided that it is not used for an explicitly commercial C purpose and that proper credit be given. SETPOINT, Inc. makes C no warranty whatsoever regarding the accuracy of this package C and will assume no liability resulting from it's use. C C **************************************************************** C C Abstract: Send a BREAK packet to signify the end of C transmissions C C MODIFICATION HISTORY C C BY DATE REASON PROGRAMS AFFECTED C C **************************************************************** C C Author: Rick Burke Version: A.0 Date: Sep-86 C C Calling Parameters: C C R X - Dummy argument required by FORTRAN C C **************************************************************** C C Messages generated by this module : None C C **************************************************************** C C Subroutines called directly : MOD, RPACK, SPACK C C **************************************************************** C C Files referenced : None C C **************************************************************** C C Local variable definitions : C C LEN - Length of response packet C NUM - Packet number of response C STATUS - Status of response packet C TV1 - Temporary variable C TV2 - Temporary variable C TV3 - Temporary variable C C **************************************************************** C C Commons referenced : None C C **************************************************************** C C (*$END.DOCUMENT*) C C **************************************************************** C * * C * D I M E N S I O N S T A T E M E N T S * C * * C **************************************************************** C IMPLICIT INTEGER (A-Z) C C **************************************************************** C * * C * T Y P E S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C * * C * C O M M O N S T A T E M E N T S * C * * C **************************************************************** C INCLUDE USL/UFTTBC INCLUDE USL/KERCOM INCLUDE USL/KERPMC C C **************************************************************** C * * C * E Q U I V A L E N C E S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C * * C * D A T A S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C C Code starts here : C C-----> Assume some kind of error. C SBREAK = BIGA C C-----> Check whether retry counter exceeded. C IF (NUMTRY .GT. MAXTRY) RETURN NUMTRY = NUMTRY + 1 C C-----> Send BREAK packet and get the response. C TNUM = N TV1 = BIGB TV2 = 0 TV3 = 0 CALL SPACK (TV1,TNUM,TV2,TV3) STATUS = RPACK (LEN,NUM,RECPKT) C C-----> Branch if response was not a NAK. C IF (STATUS .NE. BIGN) GO TO 10 IF (N .NE. NUM-1) SBREAK = STATE RETURN 10 CONTINUE C C-----> Branch if response was not an ACK. C IF (STATUS .NE. BIGY) GO TO 30 IF (N .EQ. NUM) GO TO 20 SBREAK=STATE RETURN 20 CONTINUE C C-----> Received good ACK to BREAK packet so reset retry counter, C-----> bump packet counter, and set the state to "C" (complete). C NUMTRY = 0 N = MOD (N+1,64) SBREAK = BIGC C C----> If we're in HOST mode, terminate the binary read outstanding C IF(HOSTON .EQ. NO)GO TO 25 C CALL TERMIN(IUFT(1,4),.FALSE.) C 25 CONTINUE RETURN 30 CONTINUE C C-----> Handle BAD status or unknown or ERROR packet types. C IF (STATUS .EQ. BAD) SBREAK = STATE RETURN END