=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-04-93 (21:24) Number: 160 From: QUINN TYLER JACKSON Refer#: NONE To: CASEY PEARSON Recvd: NO Subj: MODEM INTERFACE Conf: (35) Quick Basi --------------------------------------------------------------------------- Hello Casey: AS IO Tech, you'll have to help me on this one. The following is an include fil e for modem type interface. Any ideas about what might be missing? Quinn --- ' NAME: MODEM.BI ' Proposed QB-CIMR Modem Interface include file ' Written by Quinn Tyler Jackson, Project Coordinator OPTION BASE 1 TYPE MhXferStatusType XFileName AS STRING * 64 ' For returning filenames and XFileStatus AS INTEGER ' results from Zmodem tx/rx routines END TYPE TYPE MhFileSpec AFileName AS STRING * 64 ' For passing file names to ' MhZmodemSend/Receive END TYPE TYPE ZModemOptions ' Transfer options Conversion AS INTEGER ' For crash recovery, binary, newline Management AS INTEGER ' File management options SkipIfMissing AS INTEGER ' Receiver must have file or no transfer END TYPE TYPE XferInfoType Protocol AS INTEGER Direction AS INTEGER FileSpecs(150) AS MhFileSpec TxFiles AS INTEGER FileStats(150) AS MhXferStatusType RxFiles AS INTEGER DelayTicks AS INTEGER TxOpts AS ZModemOptions RxOpts AS ZModemOptions END TYPE TYPE XferType Protocol AS INTEGER 'Protocol used for transfer Direction AS INTEGER 'Whether sending or receiving Ground AS INTEGER 'Whether transfer is back or foreground File AS STRING * 64 'name and path of file being transferred END TYPE TYPE ModemStatusType Port AS INTEGER 'COM port Baud AS INTEGER 'Current baud rate Parity AS INTEGER '0, 1, 2, 3, or 4 Databits AS INTEGER '5, 6, 7, or 8 Stopbits AS INTEGER '1 or 2 Carrier AS INTEGER 'Set to false when carrier dropped Xfer AS XferType 'Information about port's transfer CSD AS INTEGER 'Carrier Signal Detect okay for this hardware DSR AS INTEGER 'Data Set Ready okay for this hardware CTS AS INTEGER 'Clear to Send is active DTR AS INTEGER 'Data Terminal Ready setting RTS AS INTEGER 'Request to Send setting END TYPE COMMON SHARED /Modem_Block/ Modem AS ModemStatusType COMMON SHARED /Modem_Block/ transfer AS XferInfoType ' The GLOBAL variable Transfer will be used like this: ' ' Transfer.Protocol = YMODEM ' Transfer.Direction = SEND ' Transfer.Filespecs(1).AFileName = "C:\AUTOEXEC.BAT" ' Transfer.DelayTicks = 1092 ' ' subFileTransfer Transfer ' ' This way, all protocols for file transfers are activated through the ' same central routine, thus making it very simple to activate a file ' file transfer. A ZMODEM transfer would be initiated in a similar ' manner to any other: ' ' Transfer.Protocol = ZMODEM ' Transfer.Direction = SEND ' Transfer.Filespecs(1).AFileName = "D:\DATA\*.DBF" ' Transfer.Filespecs(2).AFileName = "C:\CONFIG.SYS" ' Transfer.TxFiles = 2 ' Transfer.TxOpts.Management = ZM_PROTECT ' ' subFileTransfer Transfer ' ' After the ZMODEM transfer, the following routine would print a list ' of all files from Transfer.FileSpecs() that were sent successfully. ' ' FOR A = 1 TO Transfer.RxFiles ' IF Transfer.FileStats(A).XFileStatus = SENT THEN ' PRINT "File sent: ";Transfer.FileStats(A).XFileName ' END IF ' NEXT A ' ' Transfer is GLOBAL in order that the .Protocol need only be set once at ' log on, based upon the user's default protocol selection. By being ' GLOBAL, it can be modified by other parts of the BBS as need be. CONST TRUE = -1, YES = TRUE, SET = TRUE CONST FALSE = NOT TRUE, NO = FALSE, UNSET = FALSE ' Used by Parity CONST NO_PARITY = 0 CONST ODD_PARITY = 1 CONST EVEN_PARITY = 2 CONST MARK_PARITY = 3 CONST SPACE_PARITY = 4 ' Used by Xfer.Direction CONST SENDING = -1, SEND = SENDING, TX = SENDING CONST IDLE = 0 CONST RECEIVING = 1, RECEIVE = RECEIVING, RX = RECEIVING ' Used by MhXferStatusType.XFileStatus CONST SENT = 1 CONST NOT_SENT = 0 ' Used by Xfer.Ground CONST BACK = -1 'Other activities possible CONST FORE = 1 'Best to let transfer have priority ' Used by Xfer.Protocol ' NOTE: External protocols could use numbers > 8 and are Foreground CONST ASCII = 1 'Background CONST XMODEM_CHECKSUM = 2 'Background CONST XMODEM_CRC = 3 'Background CONST YMODEM = 4 'Background CONST YMODEMG = 5 'Background CONST YMODEM_BATCH = 6 'Background CONST YMODEMG_BATCH = 7 'Background CONST ZMODEM = 8 'Foreground ' ZMODEM Conversion options for ZTxOpts.Conversion CONST ZC_None = 0 ' No conversion option specified CONST ZC_Binary = 1 ' Binary transfer - inhibit conversion CONST ZC_NewLine = 2 ' Convert NL to local end of line convention CONST ZC_Resume = 3 ' Resume interrupted file transfer ' ZMODEM Management options for ZTxOpts.Management CONST ZM_NewOrLonger = 1 ' Transfer if sender's file is newer or longer CONST ZM_CRC = 2 ' Transfer if different file CRC or length