home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / LCOMMTP.ZIP / LCTP.TXT < prev    next >
Encoding:
Text File  |  1988-01-24  |  97.8 KB  |  3,367 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                       OVERVIEW
  10.                                       OVERVIEW
  11.                                       ________
  12.  
  13.  
  14.             FEATURES
  15.             FEATURES
  16.             ________
  17.  
  18.  
  19.             The LiteComm-TP Toolbox(tm) is a set of powerful routines
  20.             designed to provide easy access to the full capabilities of
  21.             the PC's asynchronous communications ports. In its initial
  22.             release, the LiteComm-TP ToolBox supports fully interrupt-
  23.             driven and buffered communications support on COM1 thru COM4
  24.             simultaneously. Now you can quickly incorporate
  25.             sophisticated communications support in your applications
  26.             without having in-depth knowledge of how the hardware
  27.             functions.
  28.  
  29.  
  30.             LiteComm-TP is implemented as a set of 3 units for the basic
  31.             product, with additional units providing the protocol-engine
  32.             capability.  The protocol engines are a part of the
  33.             registered version of the package.
  34.  
  35.  
  36.             The LiteComm ToolBox was originally developed in the C
  37.             language for use in CAD/CAM applications that required the
  38.             ability to have PC compatible systems communicating with a
  39.             variety of devices.  The introduction of version 4.0 of
  40.             Turbo PASCAL1 has made it possible for use to extend the
  41.             power and flexibility of the original LiteComm ToolBox(tm)
  42.             to Turbo PASCAL programmers.
  43.  
  44.  
  45.  
  46.             THE SHAREWARE CONCEPT
  47.             THE SHAREWARE CONCEPT
  48.             _____________________
  49.  
  50.  
  51.             Shareware is a "try before you buy" means of software
  52.             distribution. If you find a shareware product useful, pay
  53.             the registration fee, and let the authors know that you
  54.             support their efforts.
  55.  
  56.  
  57.             Information Technology, Ltd., is a member of, and supports
  58.             the standards of, ASP, The Association of Shareware
  59.             Professionals.
  60.  
  61.  
  62.  
  63.  
  64.             ____________________
  65.             1 Turbo PASCAL is a registerd trademark of Borland
  66.             International
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  77.                         for Microsoft, Datalight and Turbo C
  78.  
  79.                          LICENSE, WARRANTY AND REGISTRATION
  80.                          LICENSE, WARRANTY AND REGISTRATION
  81.                          __________________________________
  82.  
  83.  
  84.             LICENSE
  85.             LICENSE
  86.             _______
  87.  
  88.  
  89.             The LiteComm-TP ToolBox, is distributed as a shareware
  90.             product. In its shareware form, support is limited to COM1
  91.             only.  To receive the units that support the extended
  92.             features of LiteComm-TP and/or the source code for the
  93.             product, register your copy today. See the registration form
  94.             at the end of this manual.
  95.  
  96.  
  97.             Information Technology, Ltd, grants to registered users a
  98.             non-exclusive, perpetual license to the LiteComm-TP ToolBox,
  99.             subject to these terms and conditions:
  100.  
  101.  
  102.  
  103.                 1. You must treat your copy of the LiteComm-TP
  104.                    Toolbox as you would a book.  You may install
  105.                    the LiteComm-TP ToolBox on more than one
  106.                    machine, but you may use only one copy at a
  107.                    time.  If you desire, site licenses are
  108.                    available at a reduced cost.  You may make as
  109.                    many copies of the LiteComm-TP ToolBox as you
  110.                    require for the sole purpose of backup.
  111.  
  112.  
  113.                 2. You may incorporate portions of the LiteComm-TP
  114.                    ToolBox in products that you develop without the
  115.                    payment of additional royalties or license fees.
  116.                    You must include the statement 'Portions
  117.                    Copyright 1987, 1988, Information Technology,
  118.                    Ltd' in your product's documentation.
  119.  
  120.  
  121.                 3. You may copy and redistribute the shareware
  122.                    portion of the LiteComm-TP ToolBox, commonly
  123.                    known as LCOMMTP.ARC, but you may not modify in
  124.                    any way, the contents of the shareware package.
  125.                    Further, you may not charge a fee for providing
  126.                    such a copy, beyond a maximum $4.00 copying or
  127.                    duplication fee, without the express, written
  128.                    consent of Information Technology, Ltd,
  129.  
  130.  
  131.                 4. You may not redistribute, in any form, the
  132.                    source code for the LiteComm-TP ToolBox.
  133.                    Further, you may not translate the source code
  134.                    for the LiteComm-TP ToolBox into any other
  135.                    language without the express, written consent of
  136.                    Information Technology, Ltd.
  137.  
  138.                                        Page 2
  139.                   CopyRight (c) 1988 Information Technology, Ltd.
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  147.                         for Microsoft, Datalight and Turbo C
  148.  
  149.                 5. Information Technology reserves the right to
  150.                    change both the LiteComm-TP ToolBox or its
  151.                    documentation without prior notice, with no
  152.                    obligation to you, the licensee.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.                                        Page 3
  205.                   CopyRight (c) 1988 Information Technology, Ltd.
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  213.                         for Microsoft, Datalight and Turbo C
  214.  
  215.                 6. You agree that any disputes arising from this
  216.                    license will be subject to the laws of the state
  217.                    of Rhode Island.
  218.  
  219.  
  220.                 7. You agree to hold the developer and distributors
  221.                    of the LiteComm-TP ToolBox harmless for any
  222.                    damages, either direct or consequential, that
  223.                    might arise from the use of this product.
  224.  
  225.  
  226.                 8. You acknowledge that the LiteComm-TP ToolBox,
  227.                    libraries, source code, and documentation are
  228.                    the copyrighted property of Information
  229.                    Technology, Ltd.
  230.  
  231.  
  232.                 9. By your use of the LiteComm-TP ToolBox, you
  233.                    acknowledge that you have read, and understand
  234.                    the terms and conditions of this license.
  235.  
  236.  
  237.             WARRANTY
  238.             WARRANTY
  239.             ________
  240.  
  241.  
  242.             The LiteComm-TP ToolBox is distributed as-is and without
  243.             warranty, including, but not limited to, the implied
  244.             warranties of merchantability and fitness for a particular
  245.             purpose.
  246.  
  247.  
  248.             Information Technology, Ltd does warrant the distribution
  249.             media for a period of 30 days.  During that period,
  250.             Information Technology, Ltd will replace the distribution
  251.             media or provide a refund at its option.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.                                        Page 4
  273.                   CopyRight (c) 1988 Information Technology, Ltd.
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  281.                         for Microsoft, Datalight and Turbo C
  282.  
  283.             REGISTERING YOUR COPY
  284.             REGISTERING YOUR COPY
  285.             _____________________
  286.  
  287.  
  288.             Registration of your copy of the LiteComm-TP ToolBox
  289.             provides you with several benefits:
  290.  
  291.  
  292.  
  293.                 1. Puts you on our mailing list for low-cost
  294.                    updates, enhancements, and alert bulletins when
  295.                    they occur.
  296.  
  297.  
  298.                 2. Gives you access to telephone support. Sorry,
  299.                    but we cannot provide support by telephone to
  300.                    unregistered user's of the ToolBox. Unregistered
  301.                    users can leave EMAIL on Compuserve to
  302.                    70166,1152; on GEnie to I.TECH; and on DELPHI to
  303.                    RBMACE. We will respond to EMAIL on an as-
  304.                    available basis.
  305.  
  306.  
  307.                 3.Helps to further the shareware concept.
  308.  
  309.             To register your copy, use the form at the end of this
  310.             documentation. You may also register on-line through
  311.             Compuserve, GEnie, or DELPHI, using EMAIL.
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.                                        Page 5
  341.                   CopyRight (c) 1988 Information Technology, Ltd.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  349.                         for Microsoft, Datalight and Turbo C
  350.  
  351.             NOTE
  352.             NOTE
  353.             ____
  354.  
  355.  
  356.             LiteComm-TP is a package undergoing continuing development.
  357.             Registered users of the product receive, in addition to the
  358.             fully-functional base package, units that provide protocol
  359.             engines supporting XModem, and YModem protocols.
  360.  
  361.  
  362.             We plan to follow these with similar engines for Windowed
  363.             XModem CompuServe B, Telink, and other protocols. These
  364.             engines, as they are released, will only be made available
  365.             to registered ToolBox users. The shareware version, as
  366.             enhanced but without the protocol engines, will continue to
  367.             be offered.
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.                                        Page 6
  409.                   CopyRight (c) 1988 Information Technology, Ltd.
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  417.                         for Microsoft, Datalight and Turbo C
  418.  
  419.                              COMMUNICATIONS AND THE PC
  420.                              COMMUNICATIONS AND THE PC
  421.                              _________________________
  422.  
  423.  
  424.             PC SHORTCOMINGS
  425.             PC SHORTCOMINGS
  426.             _______________
  427.  
  428.  
  429.             This section is intended as a mini-tutorial on
  430.             ______________________________________________
  431.             communications concepts. We encourage you to read it,
  432.             _____________________________________________________
  433.             although it is not strictly necessary to do so.
  434.             _______________________________________________
  435.  
  436.  
  437.             The IBM-PC, and its close compatibles, is a generally well
  438.             thought-out, flexible, and well-executed computer.
  439.             Unfortunately, not as much can be said for the thought which
  440.             was given to the software which is meant to provide access
  441.             to that hardware. One of the shortcomings which is most
  442.             noticeable is in the support, or rather lack of it, that is
  443.             provided to handle access to the serial port. Support for
  444.             the serial port is limited by the BIOS to polled mode only,
  445.             i.e. a program must interrogate the port on a regular basis
  446.             to avoid losing received characters, and to check to
  447.             determine whether or not the port is ready to send a
  448.             character. Not only is this mode of operation primitive; it
  449.             also tends to cause complications when attempting to perform
  450.             any but the simplest of tasks, at slow speeds.
  451.  
  452.  
  453.             A novice might think that the hardware, in some way, is the
  454.             limiting factor. In fact, everything that is needed,
  455.             hardware-wise, to support a more sophisticated method of
  456.             handling the serial port is already there. All that is
  457.             missing is the software follow-through. The LiteComm-TP
  458.             ToolBox provides this missing software.
  459.  
  460.  
  461.  
  462.             THE 8250 UART
  463.             THE 8250 UART
  464.             _____________
  465.  
  466.  
  467.             The term serial port comes from the fact that both incoming
  468.             and outgoing characters entering and leaving the port do so
  469.             in a bitwise fashion. When we send a character out the
  470.             serial port, the responsible circuitry sends out information
  471.             one bit at a time. When we receive a character, this
  472.             circuitry accepts the individual bits and reassembles them
  473.             into a recognizable character. These very complex operations
  474.             are performed automatically by the 8250 UART (Universal
  475.             Asynchronous Receiver-Transmitter).
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.                                        Page 7
  484.                   CopyRight (c) 1988 Information Technology, Ltd.
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  492.                         for Microsoft, Datalight and Turbo C
  493.  
  494.             The 8250 UART is a fully programmable device that permits
  495.             independent control of the various parameters that affect
  496.             serial communications, i.e. baud rate, parity, number of
  497.             data bits, and number of stop bits. The 8250 also optionally
  498.             supports four types of interrupts, error/break detection,
  499.             modem status change detection, transmitter ready, and
  500.             received character ready. The LiteComm-TP ToolBox fully
  501.             supports all four type of interrupts.
  502.  
  503.  
  504.             The term asynchronous implies that there is no absolute
  505.                      asynchronous                                  
  506.                      ____________                                  
  507.             timing associated with the transmission of information.
  508.             Instead, the clocking-in of the data bits is done by
  509.                          clocking-in                            
  510.                          ___________                            
  511.             counting the bits. The first bit sent or received is call
  512.             the start bit and signals the beginning of a new character.
  513.             The individual data bits follow the start bit which are
  514.             clocked out and in at the specified data rate, with the
  515.             least significant bit transferred first and the parity bit,
  516.             if present, transferred last. Finally one or more stop bits
  517.             follow, signalling the end of the character.
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.                                        Page 8
  554.                   CopyRight (c) 1988 Information Technology, Ltd.
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  562.                         for Microsoft, Datalight and Turbo C
  563.  
  564.             The 8250 UART takes care of all of the mechanics associated
  565.             with the process described in the preceding paragraph. The
  566.             UART will also detect and report error which may occur in
  567.             the process. For example, if the parity bit is incorrect,
  568.             the UART reports the fact. If too few or too many bits are
  569.             received, the UART will report a framing error or overrun
  570.             error respectively.
  571.  
  572.  
  573.             Since the transmission of information may depend on complex
  574.             interactions with another device, such as a modem or
  575.             computer, the 8250 can also report on the status of the
  576.             handshaking lines used to provide information about the
  577.             handshaking                                            
  578.             ___________                                            
  579.             status of the connection with the other device. These
  580.             signals are explained below.
  581.  
  582.  
  583.  
  584.  
  585.                                 SIGNAL DESCRIPTIONS
  586.             
  587.            _______________________________________________________________
  588.            |                                                             |
  589.                       CTS    Clear To Send     The other device will
  590.            |                                                             |
  591.                                                accept a transmission.
  592.            |                                                             |
  593.                       DSR    Data Set Ready    The other device
  594.            |                                                             |
  595.                                                is enabled.
  596.            |                                                             |
  597.                       RI     Ring Indicator    Usually reserved
  598.            |                                                             |
  599.                                                for modems only. The
  600.            |                                                             |
  601.                                                phone is ringing
  602.            |                                                             |
  603.                       DCD    Carrier Detect    Usually reserved for
  604.            |                                                             |
  605.                                                modems. The other modem's
  606.            |                                                             |
  607.                                                 carrier signal was
  608.            |                                                             |
  609.                                                detected.
  610.            |                                                             |
  611.            _______________________________________________________________
  612.            |                                                             |
  613.  
  614.             The header file for the LiteComm-TP ToolBox contains the
  615.             various bit masks required for you to make use of the
  616.             information provided by the 8250 UART.
  617.  
  618.  
  619.  
  620.             TOOLBOX NOTES AND WARNINGS
  621.             TOOLBOX NOTES AND WARNINGS
  622.             __________________________
  623.  
  624.  
  625.             Before you can send or receive information on a serial port
  626.             using the ToolBox, you must use the open function to enable
  627.             the line. This function initializes the 8250 UART with the
  628.             correct parameters, and introduces the UART into the
  629.             interrupt structure of the PC. The ToolBox will detect, and
  630.             report, any errors that you may make in selecting the port
  631.             or specifying the initial parameters. The ToolBox cannot and
  632.             will not detect an attempt to open a non-existent serial
  633.             port.
  634.  
  635.                                        Page 9
  636.                   CopyRight (c) 1988 Information Technology, Ltd.
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  644.                         for Microsoft, Datalight and Turbo C
  645.  
  646.             The ToolBox interfaces directly with the interrupt structure
  647.             of the PC. It is critical that, before exiting a program
  648.             that has opened a serial port that the serial port is closed
  649.             with the close function. If you exit your program without
  650.             closing the port, you may cause your system to crash since
  651.             the interrupt vector for the port might point to a section
  652.             of memory that no longer contains the needed code to support
  653.             the interrupt.  As an alternative, Turbo PASCAL permits you
  654.             to install one or more exit handlers (see the PASCAL
  655.             reference).  You may use this approach to provide a safe
  656.             shutdown, but be follow carefully Borland's recommendations
  657.             about implementing exit handlers.
  658.  
  659.  
  660.             Failure of the open function can be the result of either
  661.             improper parameters to the open function, or insufficient
  662.             memory available to allocate the requested buffers and
  663.             related control structures for the port. Memory for the
  664.             transmit and receive buffers as well as the port control
  665.             block are allocated from the heap. It is your responsibility
  666.             to insure that adequate memory is available for this
  667.             purpose.
  668.  
  669.  
  670.             Unless you are very familiar with the interrupt structure of
  671.             the PC, do not attempt to manipulate the interrupt enable
  672.             flag outside of the ToolBox. The ToolBox sets and clears the
  673.             interrupt enable flag at appropriate times and assumes that
  674.             it has sole control over the flag.
  675.  
  676.  
  677.             Unless otherwise specified, all library functions have been
  678.             compiled with the default structure alignment, i.e. the
  679.             structure alignment switch has not been used in creating the
  680.             ToolBox library.
  681.  
  682.  
  683.  
  684.                                 LITECOMM-TP HISTORY
  685.                                 LITECOMM-TP HISTORY
  686.                                 ___________________
  687.  
  688.  
  689.             VERSION 1.0
  690.             VERSION 1.0
  691.             ___________
  692.  
  693.  
  694.             Version 1.0 is the first version of LiteComm-TP to be
  695.             offered to the general public, although there have been 2
  696.             Beta releases prior to Version 1.0 release.  Version 1.0 is
  697.             the functional equivalent of the original LiteComm ToolBox,
  698.             version 2.5, except for YModem support which is still
  699.             undergoing development for the C environment.
  700.  
  701.  
  702.  
  703.  
  704.  
  705.                                       Page 10
  706.                   CopyRight (c) 1988 Information Technology, Ltd.
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  714.                         for Microsoft, Datalight and Turbo C
  715.  
  716.                                     BEYOND COM2
  717.                                     BEYOND COM2
  718.                                     ___________
  719.  
  720.  
  721.             THE TOOLBOX METHODOLOGY
  722.             THE TOOLBOX METHODOLOGY
  723.             _______________________
  724.  
  725.  
  726.             In the design of the original PC, and in subsequent
  727.             variations such as the PC/AT, there were only provision for
  728.             two serial ports. Many manufacturers of add-in products,
  729.             both serial ports and internal modems have added the
  730.             capability to support 1 or more additional ports beyond the
  731.             COM2 limit. Generally, this can cause problems in the PC
  732.             since there is no room in the interrupt request scheme for
  733.             additional levels of interrupts, and there are no designated
  734.             interrupt vector for other additional ports.
  735.  
  736.  
  737.             The ToolBox approach to resolving these issues is to permit
  738.             the programmer a degree of control over the parameters that
  739.             govern the interrupt mechanism for COM3 and COM4.
  740.             Specifically, these parameters are: 1) the interrupt request
  741.             (IRQ) bit that is used to mask the 8259 interrupt
  742.             controller; 2) the interrupt vector number (not address) to
  743.             which the port is attached; and 3) the base i/o register for
  744.             the port itself. Of course, it is assumed that the port is
  745.             based upon the 8250 UART or compatible device.
  746.  
  747.  
  748.             Before you attempt to use COM3 and/or COM4, you must
  749.             determine from the port's documentation, the appropriate
  750.             values for these three parameters. As distributed, the
  751.             ToolBox assumes the following:
  752.  
  753.             
  754.             
  755.                                   COM3        COM4
  756.                                   ____        ____
  757.             
  758.                       IRQ Bit      4           3
  759.                       Vector #    0Ch         0Bh
  760.                       Base Reg    3E8h        2E8h
  761.  
  762.             You may change any or all of these values by using the
  763.             PortChange function described below, but only before you
  764.             open the port with CommOpen. Once the port has been opened,
  765.             PortChange is ineffective, and PortChange will not work on
  766.             COM1 or COM2.
  767.  
  768.  
  769.  
  770.             CAUTIONS
  771.             CAUTIONS
  772.             ________
  773.  
  774.  
  775.  
  776.  
  777.  
  778.                                       Page 11
  779.                   CopyRight (c) 1988 Information Technology, Ltd.
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  787.                         for Microsoft, Datalight and Turbo C
  788.  
  789.             There is an intimate relationship between the IRQ setting
  790.             and the interrupt vector to which it relates. In the PC,
  791.             this relationship is controlled, in part, by the 8259
  792.             interrupt controller that is set during BIOS initialization.
  793.  
  794.  
  795.             In brief, the BIOS settings for the PC (and most close
  796.             compatibles) establish IRQ0 as being vector number 08h, and
  797.             subsequent IRQ levels at increasing vector numbers. These
  798.             vector numbers (or types in INTEL terms) act as a cpu-
  799.             directed call table to locations in the lowest 1K of system
  800.             memory. We can alter how the system responds to a given
  801.             interrupt by replacing or changing the values in the
  802.             associated vector position to point to a routine which we
  803.             supply.
  804.  
  805.  
  806.             COM3 and COM4 share two critical parameters with COM1 and
  807.             COM2 respectively, the IRQ bit and the interrupt vector
  808.             number. If you intend to use COM1 with COM3 or COM2 with
  809.             COM4 simultaneously, you must change the BOTH the vector
  810.             number and the IRQ for COM3 or COM4 to an unused or un-
  811.             needed vector. The ability for your add-on ports to handle
  812.             such a change is highly hardware dependent, so check your
  813.             port's documentation carefully. Failure to do so will result
  814.             in loss of data at best, and a system lockup at worst.
  815.  
  816.  
  817.             Judging from the questions asked by some users of LiteComm-
  818.             TP, there is evidently some mis-understanding about using
  819.             ports beyond COM2, and how this all relates to your
  820.             hardware. Before you can successfully use COM3 or COM4, you
  821.             must consider the following:
  822.  
  823.  
  824.  
  825.                 1. Does the hardware permit a change to the base
  826.                    port and/or the interrupt vector to which the
  827.                    port responds.  Some expansion cards will
  828.                    support changing one and not the other, giving
  829.                    rise to potential hardware conflicts and lost
  830.                    data.
  831.  
  832.  
  833.                 2. Does the hardware permit  re-assignment of the
  834.                    IRQ priority. Some expansion cards permit you to
  835.                    alter the IRQ priority, some won't. Suffice it
  836.                    to say from the previous discussion the any
  837.                    change to the IRQ priority must allow a
  838.                    corresponding change to the interrupt vector
  839.                    number. Without this capability, reprogramming
  840.                    of the 8259 chip would be required.
  841.  
  842.  
  843.  
  844.                                       Page 12
  845.                   CopyRight (c) 1988 Information Technology, Ltd.
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  853.                         for Microsoft, Datalight and Turbo C
  854.  
  855.                 3. In fact, many add-on cards permit this dual
  856.                    change simply by making a single switch or
  857.                    jumper setting. Unfortunately, the documentation
  858.                    for these cards  generally assume that you are
  859.                    aware of the dual nature of the IRQ vector
  860.                    relationship, and may leave you with the
  861.                    impression that you are changing one and not the
  862.                    other. In most circumstances, this is not the
  863.                    case.
  864.  
  865.             The point to all of this is that LiteComm-TP can only
  866.             provide as much support as the hardware permits, or is
  867.             capable of responding to. If you wish to use other than the
  868.             default base port, interrupt vector, or irq priority for
  869.             COM3 or COM4, then your expansion card must be capable of
  870.             supporting the new values; in other words, these values are
  871.             all hardware-provided, and are recognized by the LiteComm-TP
  872.             software. If your hardware does not permit changing a value,
  873.             LiteComm-TP cannot improve the situation.
  874.  
  875.  
  876.             We should, at this point, add one final caution about how
  877.             interrupt priorities function, and their relationship to the
  878.             irq bit the you may select. The standard PC permits 8
  879.             interrupt priority levels, with the programmable timer
  880.             having the highest priority, and the parallel printer port
  881.             having the lowest priority. When an interrupt occurs, the
  882.             interrupt controller (8259 chip) masks out all other
  883.             interrupts from the priority of the interrupting device and
  884.             all lower priority devices.
  885.  
  886.  
  887.             As an aid to making COM3 and COM4 "fit", LiteComm-TP
  888.             supports interrupt chaining for the COM3 and COM4 ports. If
  889.             you use COM3 or COM4, when an interrupt occurs, the kernel
  890.             will attempt to determine if the interrupt was caused by the
  891.             supported port or from some other source.
  892.  
  893.  
  894.             If the kernel determines that the supported port did not
  895.             cause the interrupt, an automatic chain to the original
  896.             interrupt handler for that interrupt level (IRQ level) will
  897.             take place, allowing you to "patch in" or share the
  898.             available interrupt vectors.
  899.  
  900.  
  901.             If you intend to use other than the provided defaults, be
  902.             sure that you understand the interrupt mechanism. The use of
  903.             the automatic chaining described above can be particularly
  904.             troublesome under some circumstances, resulting in loss of
  905.             interrupts and, potentially, a system crash.
  906.  
  907.  
  908.  
  909.  
  910.                                       Page 13
  911.                   CopyRight (c) 1988 Information Technology, Ltd.
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  919.                         for Microsoft, Datalight and Turbo C
  920.  
  921.                                   PACKAGE CONTENTS
  922.                                   PACKAGE CONTENTS
  923.                                   ________________
  924.  
  925.             Your distribution diskette contains several files that are
  926.             important to you. All distribution diskettes, at a minimum,
  927.             include the following files in the diskette's root
  928.             directory:
  929.  
  930.             
  931.             .fo off
  932.                    PSERIAL.NUM       SERIAL NUMBER OF THIS COPY
  933.                    READ.ME           LATEST INFORMATION ABOUT
  934.                                      LITECOMM-TP
  935.             
  936.                    LTCOMM.ARC        SHAREWARE VERSION AND DOCUMENTATION
  937.                                      FILES
  938.             
  939.                    LTUNITS.ARC       FULLY FUNCTIONAL UNIT FILES
  940.             
  941.  
  942.             If you registered for the source code modules, the diskette
  943.             contains a sub directory called SOURCE.  The SOURCE
  944.             directory contains 2 source code archives.
  945.  
  946.             
  947.             
  948.                    LITECOMM-TP SOURCE CODE    LTSRC.ARC
  949.             
  950.                    XMODEM ENGINE SOURCE CODE  LTXMSRC.ARC
  951.             
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.                                       Page 14
  979.                   CopyRight (c) 1988 Information Technology, Ltd.
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  987.                         for Microsoft, Datalight and Turbo C
  988.  
  989.                              INSTALLATION INSTRUCTIONS
  990.                              INSTALLATION INSTRUCTIONS
  991.                              _________________________
  992.  
  993.             In the following discussion, we assume that your regular
  994.             ________________________________________________________
  995.             unit files are contained in a directory called \TP.
  996.                                                            \TP 
  997.             ___________________________________________________
  998.  
  999.  
  1000.             To install the unit files used with LiteComm-TP, perform the
  1001.             following steps:
  1002.  
  1003.  
  1004.  
  1005.                 1. CD \TP
  1006.  
  1007.  
  1008.                 2. ARC E A:LTUNITS
  1009.  
  1010.             Since Turbo PASCAL permits you the flexibility of having a
  1011.             separate sub-directory for units, you should execute the
  1012.             above instructions in whatever directory you use for units.
  1013.  
  1014.  
  1015.             If you are installing only the units, this completes the
  1016.             installation procedure. If you have registered for the
  1017.             package's source code, we recommend that you create a
  1018.             separate sub-directory.  The example below assumes that you
  1019.             will use a directory named COMM to hold the LiteComm-TP and
  1020.             XModem source code modules. To install the LiteComm-TP
  1021.             source code, do the following:
  1022.  
  1023.  
  1024.  
  1025.                 1. MD \COMM
  1026.  
  1027.  
  1028.                 2. CD \COMM
  1029.  
  1030.  
  1031.                 3. ARC E A:LTSRC *.*
  1032.  
  1033.  
  1034.                 4. ARC E A:LTXMSRC *.*
  1035.  
  1036.             We strongly urge that you use the recommended approach in
  1037.             handling the source code to avoid naming conflicts that
  1038.             might arise.
  1039.  
  1040.  
  1041.  
  1042.                                    GENERAL NOTES
  1043.                                    GENERAL NOTES
  1044.                                    _____________
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.                                       Page 15
  1052.                   CopyRight (c) 1988 Information Technology, Ltd.
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1060.                         for Microsoft, Datalight and Turbo C
  1061.  
  1062.             In the discussion of the various functions which follow, you
  1063.             should assume that any references to the 'port' variable
  1064.             refer to a variable or constant that may take on a value of
  1065.             from 1 to 4. No other values are acceptable, and will be
  1066.             rejected.
  1067.  
  1068.  
  1069.             While we feel that LiteComm-TP is written in the most
  1070.             efficient way possible, commensurate with good programming
  1071.             practice, we cannot be responsible for variations caused by
  1072.             hardware configurations or other factors beyond our control.
  1073.             LiteComm-TP has been tested, and is known to perform on, the
  1074.             IBM PC-AT and several compatible systems such as the Zenith
  1075.             and Wyse equivalents. LiteComm-TP has not been tested in
  1076.             environments in which other software, most significantly TSR
  1077.             (terminate and stay resident) modules exist. Some TSR
  1078.             programs that "steal" interrupts for their own purposes
  1079.             present an unfavorable environment to other programs that
  1080.             rely on the interrupt structure of the computer.
  1081.  
  1082.  
  1083.             Should you experience erratic behavior with LiteComm-TP in a
  1084.             TSR-type situation, try executing your application without
  1085.             the TSR module being present. If the problems you have
  1086.             experienced disappear, suspect the TSR module.
  1087.  
  1088.  
  1089.             Conversely, LiteComm-TP provides an excellent vehicle for
  1090.             supporting TSR programs that you may write. Since the
  1091.             package is fully reentrant, your only concern need be with
  1092.             those aspects of TSR programs are of normal concern, e.g.
  1093.             the non-reentrant nature of DOS. LiteComm-TP never uses DOS
  1094.             functions and may therefore be safely used in a TSR
  1095.             environment.
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.                                       Page 16
  1118.                   CopyRight (c) 1988 Information Technology, Ltd.
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1126.                         for Microsoft, Datalight and Turbo C
  1127.  
  1128.                           PROCEDURE AND FUNCTION REFERENCE
  1129.                           PROCEDURE AND FUNCTION REFERENCE
  1130.                           ________________________________
  1131.  
  1132.             In the following pages, we provide the detailed information
  1133.             about each of the available LiteComm-TP ToolBox functions
  1134.             and procedures.  Each definition includes, at a minimum, a
  1135.             summary of how the function or procedure is referenced, in
  1136.             which unit the function or procedure is found, a description
  1137.             of what the function or procedure does, and an indication of
  1138.             those values, if any, that might be returned.
  1139.  
  1140.  
  1141.             Where appropriate, we include additional documentation about
  1142.             the function.  Some definitions include examples, in the
  1143.             sense of code fragments illustrating the function's usage.
  1144.             More importantly, some definitions include additional notes
  1145.             and warnings as well as references to other functions within
  1146.             the package.
  1147.  
  1148.  
  1149.             We have made every effort to insure that the documentation
  1150.             of the functions is complete and accurate.  The style and
  1151.             manner of the documentation assumes that the reader is
  1152.             thoroughly familiar with the elements of C syntax and common
  1153.             conventions.
  1154.  
  1155.  
  1156.  
  1157.             UNIT USAGE
  1158.             UNIT USAGE
  1159.             __________
  1160.  
  1161.  
  1162.             To assist you in developing your own applications, you will
  1163.             need to know the following information.
  1164.  
  1165.  
  1166.                          Unit                    Uses
  1167.             
  1168.                        LctKrnl                   DOS
  1169.                        LctSupp                   DOS, LctKrnl
  1170.                        LctHayes                  DOS, LctSupp
  1171.                        LcTimer                   DOS *
  1172.                        LTXMKrnl                  DOS, LctSupp, LcTimer *
  1173.                        LTXModem                  DOS, LctSupp, LTXMKrnl
  1174.                                                  LcTimer *
  1175.             
  1176.             * This unit part of registered version only.
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.                                       Page 17
  1188.                   CopyRight (c) 1988 Information Technology, Ltd.
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1196.                         for Microsoft, Datalight and Turbo C
  1197.  
  1198.            _______________________________________________________________
  1199.            _______________________________________________________________
  1200.  
  1201.                PortChange function                           LctKrnl
  1202.                PortChange function                           LctKrnl
  1203.            _______________________________________________________________
  1204.            _______________________________________________________________
  1205.  
  1206.  
  1207.             FUNCTION
  1208.             FUNCTION
  1209.             ________
  1210.  
  1211.             Changes one or more of the critical parameters for port COM3
  1212.             or COM4.
  1213.  
  1214.  
  1215.  
  1216.             DECLARATION
  1217.             DECLARATION
  1218.             ___________
  1219.  
  1220.             Portchange(CPort:integer; NewBase:word; NewIrq,
  1221.             NewVector:byte)
  1222.  
  1223.  
  1224.  
  1225.             RESULT TYPE
  1226.             RESULT TYPE
  1227.             ___________
  1228.  
  1229.                  boolean
  1230.  
  1231.  
  1232.  
  1233.             REMARKS
  1234.             REMARKS
  1235.             _______
  1236.  
  1237.             This function must be used before the port is opened to be
  1238.             effective. To leave any of the parameters at its default
  1239.             value, make the corresponding entry 0. Note that vector is a
  1240.             vector number, not an address or pointer.
  1241.  
  1242.  
  1243.             The irq parameter should not be taken to be the irq
  1244.             (interrupt request number), but rather the irq mask. For
  1245.             example, the correct value for irq4 is NOT 4, but a byte in
  1246.             which bit 4, using INTEL's bit numbering, is set to a value
  1247.             of 1. Thus, to use irq priority 4 as the irq for either COM3
  1248.             or COM4, you would specify $10 as the value of irq when
  1249.             calling PortChange.
  1250.  
  1251.  
  1252.             If you intend to change the default irq settings, you MUST
  1253.             also make a corresponding change to the vector number. See
  1254.             the preceding section about using COM3 and COM4 for
  1255.             additional details. Failure to follow this rule may make the
  1256.             port appear to be non-functional.
  1257.  
  1258.  
  1259.             The PortChange function does NOT check to determine that you
  1260.             have provided both an IRQ mask AND a new vector number.
  1261.  
  1262.  
  1263.  
  1264.  
  1265.                                       Page 18
  1266.                   CopyRight (c) 1988 Information Technology, Ltd.
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1274.                         for Microsoft, Datalight and Turbo C
  1275.  
  1276.             PortChange returns a value of TRUE if the change was
  1277.             successful, false otherwise.
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.                                       Page 19
  1332.                   CopyRight (c) 1988 Information Technology, Ltd.
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1340.                         for Microsoft, Datalight and Turbo C
  1341.  
  1342.             EXAMPLE
  1343.             EXAMPLE
  1344.             _______
  1345.  
  1346.                  Var
  1347.                     Newbase : word;
  1348.                     Newirq : byte;
  1349.                     NewVector : byte;
  1350.                     
  1351.                     Begin
  1352.                       Newbase := $03E8;
  1353.                       Newirq := $10;
  1354.                       NewVector := $0C;
  1355.                     
  1356.                       if PortChange(3, Newbase, Newirq, NewVector)
  1357.                     then
  1358.                       Writeln('Port 3 Changed')
  1359.                     else
  1360.                       Writeln('Error changing Port 3');
  1361.                     end;
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.                                       Page 20
  1400.                   CopyRight (c) 1988 Information Technology, Ltd.
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1408.                         for Microsoft, Datalight and Turbo C
  1409.  
  1410.            _______________________________________________________________
  1411.            _______________________________________________________________
  1412.  
  1413.                CommOpen function                             LctKrnl
  1414.                CommOpen function                             LctKrnl
  1415.            _______________________________________________________________
  1416.            _______________________________________________________________
  1417.  
  1418.  
  1419.             FUNCTION
  1420.             FUNCTION
  1421.             ________
  1422.  
  1423.             Prepares the specified port for use by the other functions
  1424.  
  1425.  
  1426.  
  1427.             DECLARATION
  1428.             DECLARATION
  1429.             ___________
  1430.  
  1431.             CommOpen(CPort, Baud:integer; Parity:char; Databits,
  1432.             Stopbits, InSize, OutSize:integer)
  1433.  
  1434.  
  1435.  
  1436.             RESULT TYPE
  1437.             RESULT TYPE
  1438.             ___________
  1439.  
  1440.                  boolean
  1441.  
  1442.  
  1443.  
  1444.             REMARKS
  1445.             REMARKS
  1446.             _______
  1447.  
  1448.             Opens the specified port for use and attaches an interrupt
  1449.             handler to DOS for the port. The function allocates buffers
  1450.             for input and output of the specified sizes, and sets the
  1451.             port to the parameters specified. The minimum value for
  1452.             InSize is 128; the minimum size for OutSize is 64. A port
  1453.             opened in this manner must be closed using CommClose before
  1454.             program termination to avoid the possibility of a system
  1455.             crash.
  1456.  
  1457.  
  1458.             The parameters passed to the function are discrete values,
  1459.             and must be drawn from the following lists:
  1460.  
  1461.  
  1462.             Baud: 110, 300, 600, 1200, 2400, 4800, 9600, 19200
  1463.             Parity: E, O, N, M, S
  1464.                  E - Even
  1465.                  O - Odd
  1466.                  N - None
  1467.                  M - Mark
  1468.                  S - Space
  1469.             Databits: 5, 6, 7, 8
  1470.             StopBits: 1, 2
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.                                       Page 21
  1478.                   CopyRight (c) 1988 Information Technology, Ltd.
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1486.                         for Microsoft, Datalight and Turbo C
  1487.  
  1488.             A return of TRUE indicates the port has been successfully
  1489.             opened and is ready for use.  A return of FALSE indicates an
  1490.             error occurred, either as the result of an invalid
  1491.             parameter, or insufficient heap space available to allocate
  1492.             the buffers and control structures for the port.
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.                                       Page 22
  1544.                   CopyRight (c) 1988 Information Technology, Ltd.
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1552.                         for Microsoft, Datalight and Turbo C
  1553.  
  1554.             EXAMPLE
  1555.             EXAMPLE
  1556.             _______
  1557.  
  1558.                  Var
  1559.                     Baud, Databits, Stopbits : integer;
  1560.                     Parity : char;
  1561.                     Insize, Outsize : integer;
  1562.                     
  1563.                     begin
  1564.                       Baud := 2400;
  1565.                       Parity := 'E';
  1566.                       Databits := 7;
  1567.                       Stopbits := 1;
  1568.                       Insize := 256;
  1569.                       Outsize := 256;
  1570.                     
  1571.                       if CommOpen(1, Baud, Parity, Databits,
  1572.                     Stopbits, Insize, Outsize) then
  1573.                            Writeln('COM1 available for use')
  1574.                       else
  1575.                            Writeln('Error opening COM1');
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.                                       Page 23
  1612.                   CopyRight (c) 1988 Information Technology, Ltd.
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1620.                         for Microsoft, Datalight and Turbo C
  1621.  
  1622.            _______________________________________________________________
  1623.            _______________________________________________________________
  1624.  
  1625.                CommClose procedure                           LctKrnl
  1626.                CommClose procedure                           LctKrnl
  1627.            _______________________________________________________________
  1628.            _______________________________________________________________
  1629.  
  1630.  
  1631.             FUNCTION
  1632.             FUNCTION
  1633.             ________
  1634.  
  1635.             Closes a port that has been opened by the CommOpen function
  1636.  
  1637.  
  1638.  
  1639.             DECLARATION
  1640.             DECLARATION
  1641.             ___________
  1642.  
  1643.             CommClose(CPort:integer)
  1644.  
  1645.  
  1646.  
  1647.             REMARKS
  1648.             REMARKS
  1649.             _______
  1650.  
  1651.             This function is the companion to CommOpen and, in effect,
  1652.             performs the opposite action. CommClose detaches the kernel
  1653.             interrupt handler from the port, and reconnects the previous
  1654.             interrupt handler. CommClose also release dynamically
  1655.             allocated memory used for buffering and control structures.
  1656.             Failure to call CommClose before terminating a program may
  1657.             result in unexplained system crashes or hangs.
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.                                       Page 24
  1688.                   CopyRight (c) 1988 Information Technology, Ltd.
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1696.                         for Microsoft, Datalight and Turbo C
  1697.  
  1698.            _______________________________________________________________
  1699.            _______________________________________________________________
  1700.  
  1701.                CommSetup function                            LctKrnl
  1702.                CommSetup function                            LctKrnl
  1703.            _______________________________________________________________
  1704.            _______________________________________________________________
  1705.  
  1706.  
  1707.             FUNCTION
  1708.             FUNCTION
  1709.             ________
  1710.  
  1711.             Provides the capability of changing the parameters for an
  1712.             open port, without breaking the connection or closing the
  1713.             port.
  1714.  
  1715.  
  1716.  
  1717.             DECLARATION
  1718.             DECLARATION
  1719.             ___________
  1720.  
  1721.             CommSetup(CPort, Baud:integer; Parity:char; Databits,
  1722.             Stopbits:integer)
  1723.  
  1724.  
  1725.  
  1726.             RESULT TYPE
  1727.             RESULT TYPE
  1728.             ___________
  1729.  
  1730.                  boolean
  1731.  
  1732.  
  1733.  
  1734.             REMARKS
  1735.             REMARKS
  1736.             _______
  1737.  
  1738.             The CommSetup function is a subset of the CommOpen function
  1739.             and the remarks made in the description of CommOpen apply.
  1740.             This function is useful if you wish to change the basic
  1741.             communication parameters of the specified port that has
  1742.             already been opened without CommClose'ing the port and
  1743.             breaking the connection.
  1744.  
  1745.  
  1746.  
  1747.             SEE ALSO
  1748.             SEE ALSO
  1749.             ________
  1750.  
  1751.                  CommOpen
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.                                       Page 25
  1768.                   CopyRight (c) 1988 Information Technology, Ltd.
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1776.                         for Microsoft, Datalight and Turbo C
  1777.  
  1778.            _______________________________________________________________
  1779.            _______________________________________________________________
  1780.  
  1781.                ValidatePort function                         LctKrnl
  1782.                ValidatePort function                         LctKrnl
  1783.            _______________________________________________________________
  1784.            _______________________________________________________________
  1785.  
  1786.  
  1787.             FUNCTION
  1788.             FUNCTION
  1789.             ________
  1790.  
  1791.             Verifies that the specified port has been opened and returns
  1792.             a pointer to the Communications Control Block for the port.
  1793.  
  1794.  
  1795.  
  1796.             DECLARATION
  1797.             DECLARATION
  1798.             ___________
  1799.  
  1800.             ValidatePort(CPort:integer)
  1801.  
  1802.  
  1803.  
  1804.             RESULT TYPE
  1805.             RESULT TYPE
  1806.             ___________
  1807.  
  1808.                  CCBPTR
  1809.  
  1810.  
  1811.  
  1812.             REMARKS
  1813.             REMARKS
  1814.             _______
  1815.  
  1816.             Used internally to validate that the port number specified
  1817.             is correct and has been opened with the CommOpen function.
  1818.             May be of use to you in writing certain applications that
  1819.             require access to the Communications Control Block.  The
  1820.             function returns a value of NIL if the specified port is
  1821.             incorrect or not open.
  1822.  
  1823.  
  1824.  
  1825.             EXAMPLE
  1826.             EXAMPLE
  1827.             _______
  1828.  
  1829.                  if ValidatePort(2) <> NIL then
  1830.                       Writeln('The port has been opened')
  1831.                     else
  1832.                       Writeln('The port is nor presently open');
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.                                       Page 26
  1848.                   CopyRight (c) 1988 Information Technology, Ltd.
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1856.                         for Microsoft, Datalight and Turbo C
  1857.  
  1858.            _______________________________________________________________
  1859.            _______________________________________________________________
  1860.  
  1861.                BytesInInput function                         LctSupp
  1862.                BytesInInput function                         LctSupp
  1863.            _______________________________________________________________
  1864.            _______________________________________________________________
  1865.  
  1866.  
  1867.             FUNCTION
  1868.             FUNCTION
  1869.             ________
  1870.  
  1871.             Returns the number of characters currently available in the
  1872.             input buffer (BytesInInput) or the number of untransmitted
  1873.             characters in the output buffer (ByteInOutput).
  1874.  
  1875.  
  1876.  
  1877.             DECLARATION
  1878.             DECLARATION
  1879.             ___________
  1880.  
  1881.             BytesInInput(CPort:integer)
  1882.             BytesInOutput(CPort:integer)
  1883.  
  1884.  
  1885.  
  1886.             RESULT TYPE
  1887.             RESULT TYPE
  1888.             ___________
  1889.  
  1890.                  integer
  1891.  
  1892.  
  1893.  
  1894.             REMARKS
  1895.             REMARKS
  1896.             _______
  1897.  
  1898.             May be used to determine the number of characters currently
  1899.             in the input (BytesInInput) or output (BytesInOutput)
  1900.             buffers for the port. In the event of an error (bad port), a
  1901.             value of -1 is returned.
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.                                       Page 27
  1926.                   CopyRight (c) 1988 Information Technology, Ltd.
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  1934.                         for Microsoft, Datalight and Turbo C
  1935.  
  1936.            _______________________________________________________________
  1937.            _______________________________________________________________
  1938.  
  1939.                ModemStatus function                          LctKrnl
  1940.                ModemStatus function                          LctKrnl
  1941.            _______________________________________________________________
  1942.            _______________________________________________________________
  1943.  
  1944.  
  1945.             FUNCTION
  1946.             FUNCTION
  1947.             ________
  1948.  
  1949.             Returns the last know status of the modem control lines for
  1950.             the specified port.
  1951.  
  1952.  
  1953.  
  1954.             DECLARATION
  1955.             DECLARATION
  1956.             ___________
  1957.  
  1958.             ModemStatus(CPort:integer)
  1959.  
  1960.  
  1961.  
  1962.             RESULT TYPE
  1963.             RESULT TYPE
  1964.             ___________
  1965.  
  1966.                  byte
  1967.  
  1968.  
  1969.  
  1970.             REMARKS
  1971.             REMARKS
  1972.             _______
  1973.  
  1974.             Use this function to determine the last known state of the
  1975.             modem-supplied handshake signals. These may be tested using
  1976.             the values included in the unit, using PASCAL's bitwise AND
  1977.             operator.  NOTE: You should be aware that the handshake
  1978.             signals returned are reset once this function is called.
  1979.             Subsequent calls to this function will return to last known
  1980.             value for all signals.  The signals which are tracked are
  1981.             CTS, DSR, RI, and DCD.
  1982.  
  1983.  
  1984.             To determine which signals, if any, have changed use the
  1985.             DeltaXXX bits returned. For example, if CTS has changed, the
  1986.             DeltaCTS bit will be set.  The actual CTS value (on or off)
  1987.             will be found in the CTS bit of the returned byte.
  1988.  
  1989.  
  1990.             In the event of an error, a byte of $00 is returned.
  1991.  
  1992.  
  1993.  
  1994.             EXAMPLE
  1995.             EXAMPLE
  1996.             _______
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.                                       Page 28
  2006.                   CopyRight (c) 1988 Information Technology, Ltd.
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2014.                         for Microsoft, Datalight and Turbo C
  2015.  
  2016.                  Var
  2017.                     CStat : byte;
  2018.                     
  2019.                     begin
  2020.                       CStat := ModemStatus(1);
  2021.                       if CStat and DeltaCTS = DeltaCTS then
  2022.                         if CStat and CTS <> CTS then
  2023.                            Writeln('The connection is broken');
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.                                       Page 29
  2072.                   CopyRight (c) 1988 Information Technology, Ltd.
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2080.                         for Microsoft, Datalight and Turbo C
  2081.  
  2082.            _______________________________________________________________
  2083.            _______________________________________________________________
  2084.  
  2085.                ErrorStatus function                          LctKrnl
  2086.                ErrorStatus function                          LctKrnl
  2087.            _______________________________________________________________
  2088.            _______________________________________________________________
  2089.  
  2090.  
  2091.             FUNCTION
  2092.             FUNCTION
  2093.             ________
  2094.  
  2095.             Return the last known error status for the specified port.
  2096.  
  2097.  
  2098.  
  2099.             DECLARATION
  2100.             DECLARATION
  2101.             ___________
  2102.  
  2103.             ErrorStatus(CPort:integer)
  2104.  
  2105.  
  2106.  
  2107.             RESULT TYPE
  2108.             RESULT TYPE
  2109.             ___________
  2110.  
  2111.                  byte
  2112.  
  2113.  
  2114.  
  2115.             REMARKS
  2116.             REMARKS
  2117.             _______
  2118.  
  2119.             Returns the last known state of the serial port's error
  2120.             status bits, encoded in a byte. These may be tested using
  2121.             the constants defined in the unit in conjunction with
  2122.             PASCAL's bitwise AND operator.  The applicable values that
  2123.             may be checked are OverRun, BadParity, BadFrame, and
  2124.             BreakDet.  In the event of an error, a byte of $00 is
  2125.             returned.
  2126.  
  2127.  
  2128.             Once the error status bits have been read in this fashion,
  2129.             they are reset to $00, and will remain so until the next
  2130.             error occurs.  Since this process happens asynchronously, it
  2131.             is not possible for your application to determine which
  2132.             character created the error, only that the error occurred.
  2133.  
  2134.  
  2135.  
  2136.             EXAMPLE
  2137.             EXAMPLE
  2138.             _______
  2139.  
  2140.                  Var
  2141.                     EStat : byte;
  2142.                     
  2143.                     begin
  2144.                       EStat := ErrorStatus(2);
  2145.                       if EStat and BreakDet = BreakDet then
  2146.                         Writeln('Break Signal detected on Port 2');
  2147.  
  2148.  
  2149.  
  2150.  
  2151.                                       Page 30
  2152.                   CopyRight (c) 1988 Information Technology, Ltd.
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2160.                         for Microsoft, Datalight and Turbo C
  2161.  
  2162.            _______________________________________________________________
  2163.            _______________________________________________________________
  2164.  
  2165.                SetModemSignals function                      LctKrnl
  2166.                SetModemSignals function                      LctKrnl
  2167.            _______________________________________________________________
  2168.            _______________________________________________________________
  2169.  
  2170.  
  2171.             FUNCTION
  2172.             FUNCTION
  2173.             ________
  2174.  
  2175.             Allows the programmer to set the individual modem control
  2176.             lines for the specified port.
  2177.  
  2178.  
  2179.  
  2180.             DECLARATION
  2181.             DECLARATION
  2182.             ___________
  2183.  
  2184.             SetModemSignals(CPort:integer; NewSet:byte)
  2185.  
  2186.  
  2187.  
  2188.             RESULT TYPE
  2189.             RESULT TYPE
  2190.             ___________
  2191.  
  2192.                  boolean
  2193.  
  2194.  
  2195.  
  2196.             REMARKS
  2197.             REMARKS
  2198.             _______
  2199.  
  2200.             Set one or more of the modem control signals. Because of the
  2201.             need to always have OUT2 set for interrupt support, the
  2202.             function always provides the correct setting for this bit.
  2203.  
  2204.  
  2205.             The value of NewSet is bitwise OR'ed with the current set of
  2206.             values to produce a new modem control setting.  The value of
  2207.             NewSet DOES NOT replace the current values. Use the
  2208.             constants supplied in the unit to obtain the correct values.
  2209.             These include DTR and RTS.
  2210.  
  2211.  
  2212.  
  2213.             EXAMPLE
  2214.             EXAMPLE
  2215.             _______
  2216.  
  2217.                  begin
  2218.                     if SetModemSignals(1, (DTR and RTS)) then
  2219.                       Writeln('Port is ready to transmit')
  2220.                     else
  2221.                       Writeln('Unable to set modem signals');
  2222.  
  2223.  
  2224.             SEE ALSO
  2225.             SEE ALSO
  2226.             ________
  2227.                  ClearModemSignals, FlipModemSignals
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.                                       Page 31
  2234.                   CopyRight (c) 1988 Information Technology, Ltd.
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2242.                         for Microsoft, Datalight and Turbo C
  2243.  
  2244.            _______________________________________________________________
  2245.            _______________________________________________________________
  2246.  
  2247.                ClearModemSignals function                    LctKrnl
  2248.                ClearModemSignals function                    LctKrnl
  2249.            _______________________________________________________________
  2250.            _______________________________________________________________
  2251.  
  2252.  
  2253.             FUNCTION
  2254.             FUNCTION
  2255.             ________
  2256.  
  2257.             Allows the programmer to clear (reset) the individual modem
  2258.             control lines for the specified port.
  2259.  
  2260.  
  2261.  
  2262.             DECLARATION
  2263.             DECLARATION
  2264.             ___________
  2265.  
  2266.             ClearModemSignals(CPort:integer; NewSet:byte)
  2267.  
  2268.  
  2269.  
  2270.             RESULT TYPE
  2271.             RESULT TYPE
  2272.             ___________
  2273.  
  2274.                  boolean
  2275.  
  2276.  
  2277.  
  2278.             REMARKS
  2279.             REMARKS
  2280.             _______
  2281.  
  2282.             Clears (resets) one or more of the modem control signals.
  2283.             Because of the need to always have OUT2 set for interrupt
  2284.             support, the function always provides the correct setting
  2285.             for this bit.
  2286.  
  2287.  
  2288.             The compliment of NewSet is bitwise AND'ed with the current
  2289.             set of values to produce a new modem control setting.  The
  2290.             value of NewSet DOES NOT replace the current values. Use the
  2291.             constants supplied in the unit to obtain the correct values.
  2292.             These include DTR and RTS.
  2293.  
  2294.  
  2295.  
  2296.             EXAMPLE
  2297.             EXAMPLE
  2298.             _______
  2299.  
  2300.                  begin
  2301.                     if ClearModemSignals(1,  RTS) then
  2302.                       Writeln('RTS for Port 1 has been dropped')
  2303.                     else
  2304.                       Writeln('Unable to clear RTS');
  2305.  
  2306.  
  2307.             SEE ALSO
  2308.             SEE ALSO
  2309.             ________
  2310.                  SetModemSignals, FlipModemSignals
  2311.  
  2312.  
  2313.  
  2314.  
  2315.                                       Page 32
  2316.                   CopyRight (c) 1988 Information Technology, Ltd.
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2324.                         for Microsoft, Datalight and Turbo C
  2325.  
  2326.            _______________________________________________________________
  2327.            _______________________________________________________________
  2328.  
  2329.                FlipModemSignals function                     LctKrnl
  2330.                FlipModemSignals function                     LctKrnl
  2331.            _______________________________________________________________
  2332.            _______________________________________________________________
  2333.  
  2334.  
  2335.             FUNCTION
  2336.             FUNCTION
  2337.             ________
  2338.  
  2339.             Allows the programmer to compliment(toggle) the individual
  2340.             modem control lines for the specified port.
  2341.  
  2342.  
  2343.  
  2344.             DECLARATION
  2345.             DECLARATION
  2346.             ___________
  2347.  
  2348.             FlipModemSignals(CPort:integer; NewSet:byte)
  2349.  
  2350.  
  2351.  
  2352.             RESULT TYPE
  2353.             RESULT TYPE
  2354.             ___________
  2355.  
  2356.                  boolean
  2357.  
  2358.  
  2359.  
  2360.             REMARKS
  2361.             REMARKS
  2362.             _______
  2363.  
  2364.             Complements(toggles) one or more of the modem control
  2365.             signals. Because of the need to always have OUT2 set for
  2366.             interrupt support, the function always provides the correct
  2367.             setting for this bit.
  2368.  
  2369.  
  2370.             The value of NewSet is bitwise XOR'ed with the current set
  2371.             of values to produce a new modem control setting.  The value
  2372.             of NewSet DOES NOT replace the current values. Use the
  2373.             constants supplied in the unit to obtain the correct values.
  2374.             These include DTR and RTS.
  2375.  
  2376.  
  2377.  
  2378.             EXAMPLE
  2379.             EXAMPLE
  2380.             _______
  2381.  
  2382.                  begin
  2383.                     if FlipModemSignals(1, RTS) then
  2384.                       Writeln('RTS for Port 1 has been changed')
  2385.                     else
  2386.                       Writeln('Unable to change RTS');
  2387.  
  2388.  
  2389.             SEE ALSO
  2390.             SEE ALSO
  2391.             ________
  2392.                  SetModemSignals, ClearModemSignals
  2393.  
  2394.  
  2395.  
  2396.  
  2397.                                       Page 33
  2398.                   CopyRight (c) 1988 Information Technology, Ltd.
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2406.                         for Microsoft, Datalight and Turbo C
  2407.  
  2408.            _______________________________________________________________
  2409.            _______________________________________________________________
  2410.  
  2411.                EnableXon function                            LctKrnl
  2412.                EnableXon function                            LctKrnl
  2413.            _______________________________________________________________
  2414.            _______________________________________________________________
  2415.  
  2416.  
  2417.             FUNCTION
  2418.             FUNCTION
  2419.             ________
  2420.  
  2421.  
  2422.             Enable or disable the semi-automatic flow control features
  2423.             of LiteComm-TP
  2424.  
  2425.  
  2426.  
  2427.             DECLARATION
  2428.             DECLARATION
  2429.             ___________
  2430.  
  2431.             EnableXon(CPort:integer; XonFlag:boolean)
  2432.  
  2433.  
  2434.  
  2435.             RESULT TYPE
  2436.             RESULT TYPE
  2437.             ___________
  2438.  
  2439.                  boolean;
  2440.  
  2441.  
  2442.  
  2443.             DESCRIPTION
  2444.             DESCRIPTION
  2445.             ___________
  2446.  
  2447.             If XonFlag is TRUE, turns on semi-automatic XON-XOFF flow
  2448.             control function. If XonFlag is FALSE (the default setting),
  2449.             automatic flow control is disabled. When enabled, the kernel
  2450.             will automatically transmit an XOFF if and when the input
  2451.             buffer is approximately 2/3 full and will automatically
  2452.             recognize an XOFF sent by the companion system. If the
  2453.             companion system transmits an XOFF, the kernel will refuse
  2454.             to send any characters until the condition is cleared.
  2455.  
  2456.  
  2457.             It is the programmer's responsibility to transmit XON when
  2458.             conditions permit. See the XoffSent function to tell if an
  2459.             automatic XOFF has been sent by the kernel. See the XoffRecd
  2460.             function to determine if the kernel has detected an XOFF.
  2461.  
  2462.  
  2463.             If you intended to implement a protocol that might include
  2464.             the XON-XOFF characters, be sure to disable the automatic
  2465.             flow control. Failure to do so may result in a system hang.
  2466.  
  2467.  
  2468.  
  2469.             SEE ALSO
  2470.             SEE ALSO
  2471.             ________
  2472.  
  2473.                  XoffRecd, XoffRecd
  2474.  
  2475.  
  2476.  
  2477.                                       Page 34
  2478.                   CopyRight (c) 1988 Information Technology, Ltd.
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2486.                         for Microsoft, Datalight and Turbo C
  2487.  
  2488.            _______________________________________________________________
  2489.            _______________________________________________________________
  2490.  
  2491.                XoffRecd function                             LctKrnl
  2492.                XoffRecd function                             LctKrnl
  2493.            _______________________________________________________________
  2494.            _______________________________________________________________
  2495.  
  2496.  
  2497.             FUNCTION
  2498.             FUNCTION
  2499.             ________
  2500.  
  2501.             Reports whether or not the kernel has detected an XOFF from
  2502.             the companion system
  2503.  
  2504.  
  2505.  
  2506.             DECLARATION
  2507.             DECLARATION
  2508.             ___________
  2509.  
  2510.             XoffRecd(CPort:integer)
  2511.  
  2512.  
  2513.  
  2514.             RESULT TYPE
  2515.             RESULT TYPE
  2516.             ___________
  2517.  
  2518.                  boolean
  2519.  
  2520.  
  2521.  
  2522.             REMARKS
  2523.             REMARKS
  2524.             _______
  2525.  
  2526.             Returns TRUE if an XOFF has been received, FALSE otherwise.
  2527.             If an XOFF has been received, the port's flag will be reset,
  2528.             and transmission to the companion system will be permitted.
  2529.             If an XON is received from the companion system, the port's
  2530.             flag will also be reset, permitting further transmissions to
  2531.             occur. Be aware that if the companion system never sends an
  2532.             XON after sending an XOFF, a possible race condition may
  2533.                                                   race              
  2534.                                                   ____              
  2535.             occur, resulting in a system hang.
  2536.  
  2537.  
  2538.  
  2539.             SEE ALSO
  2540.             SEE ALSO
  2541.             ________
  2542.  
  2543.                  EnableXon, XoffSent
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.                                       Page 35
  2560.                   CopyRight (c) 1988 Information Technology, Ltd.
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2568.                         for Microsoft, Datalight and Turbo C
  2569.  
  2570.            _______________________________________________________________
  2571.            _______________________________________________________________
  2572.  
  2573.             XoffSent function                                LctKrnl
  2574.             XoffSent function                                LctKrnl
  2575.            _______________________________________________________________
  2576.            _______________________________________________________________
  2577.  
  2578.  
  2579.             FUNCTION
  2580.             FUNCTION
  2581.             ________
  2582.  
  2583.             Reports whether or not the kernel has automatically sent an
  2584.             XOFF to the companion system.
  2585.  
  2586.  
  2587.  
  2588.             DECLARATION
  2589.             DECLARATION
  2590.             ___________
  2591.  
  2592.             XoffSent(CPort:integer)
  2593.  
  2594.  
  2595.  
  2596.             RESULT TYPE
  2597.             RESULT TYPE
  2598.             ___________
  2599.  
  2600.                  boolean
  2601.  
  2602.  
  2603.  
  2604.             REMARKS
  2605.             REMARKS
  2606.             _______
  2607.  
  2608.             Returns TRUE if the kernel has sent an XOFF to the companion
  2609.             system, FALSE otherwise. If an XOFF has been sent, the
  2610.             port's flag will be reset. You must send an XON character to
  2611.             the companion system to permit transmissions to proceed.
  2612.  
  2613.  
  2614.  
  2615.             SEE ALSO
  2616.             SEE ALSO
  2617.             ________
  2618.  
  2619.                  EnableXon, XoffRecd
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.                                       Page 36
  2640.                   CopyRight (c) 1988 Information Technology, Ltd.
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2648.                         for Microsoft, Datalight and Turbo C
  2649.  
  2650.            _______________________________________________________________
  2651.            _______________________________________________________________
  2652.  
  2653.                LctGet function                               LctSupp
  2654.                LctGet function                               LctSupp
  2655.            _______________________________________________________________
  2656.            _______________________________________________________________
  2657.  
  2658.  
  2659.             FUNCTION
  2660.             FUNCTION
  2661.             ________
  2662.  
  2663.             Returns an available character from the ports input buffer.
  2664.  
  2665.  
  2666.  
  2667.             DECLARATION
  2668.             DECLARATION
  2669.             ___________
  2670.  
  2671.             LctGet(CPort:integer; var Ch:byte)
  2672.  
  2673.  
  2674.  
  2675.             RESULT TYPE
  2676.             RESULT TYPE
  2677.             ___________
  2678.  
  2679.                  boolean
  2680.  
  2681.  
  2682.  
  2683.             REMARKS
  2684.             REMARKS
  2685.             _______
  2686.  
  2687.             Places the next available character in the input buffer for
  2688.             the port in Ch. The function returns a value of TRUE if
  2689.             there is a character available, FALSE if there is no
  2690.             character available or on an error.  The contents of Ch are
  2691.             undefined when the return is FALSE.
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.                                       Page 37
  2718.                   CopyRight (c) 1988 Information Technology, Ltd.
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2726.                         for Microsoft, Datalight and Turbo C
  2727.  
  2728.            _______________________________________________________________
  2729.            _______________________________________________________________
  2730.  
  2731.                LctPeek function                              LctSupp
  2732.                LctPeek function                              LctSupp
  2733.            _______________________________________________________________
  2734.            _______________________________________________________________
  2735.  
  2736.  
  2737.             FUNCTION
  2738.             FUNCTION
  2739.             ________
  2740.  
  2741.             Permits you to look at the next character in the ports input
  2742.             buffer without removing if from the buffer.
  2743.  
  2744.  
  2745.  
  2746.             DECLARATION
  2747.             DECLARATION
  2748.             ___________
  2749.  
  2750.             LctPeek(CPort:integer; var Ch:byte)
  2751.  
  2752.  
  2753.  
  2754.             RESULT TYPE
  2755.             RESULT TYPE
  2756.             ___________
  2757.  
  2758.                  boolean
  2759.  
  2760.  
  2761.  
  2762.             REMARKS
  2763.             REMARKS
  2764.             _______
  2765.  
  2766.             Places the next available character in the input buffer for
  2767.             the specified port into the Ch variable, but does not remove
  2768.             the character from the buffer. This allows the application
  2769.             to look-ahead by one character in a non-destructive fashion.
  2770.                look-ahead                                               
  2771.                __________                                               
  2772.             Returns FALSE if the port is not active, or if there are no
  2773.             characters in the port's buffer, TRUE otherwise. The
  2774.             contents of Ch are undefined when the result is FALSE
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.                                       Page 38
  2798.                   CopyRight (c) 1988 Information Technology, Ltd.
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2806.                         for Microsoft, Datalight and Turbo C
  2807.  
  2808.            _______________________________________________________________
  2809.            _______________________________________________________________
  2810.  
  2811.                LctPut function                               LctSupp
  2812.                LctPut function                               LctSupp
  2813.            _______________________________________________________________
  2814.            _______________________________________________________________
  2815.  
  2816.  
  2817.             FUNCTION
  2818.             FUNCTION
  2819.             ________
  2820.  
  2821.             Places a character in the port's transmit buffer to be sent
  2822.             when the port is ready.
  2823.  
  2824.  
  2825.  
  2826.             DECLARATION
  2827.             DECLARATION
  2828.             ___________
  2829.  
  2830.             LctPut(CPort:integer; Ch:byte)
  2831.  
  2832.  
  2833.  
  2834.             RESULT TYPE
  2835.             RESULT TYPE
  2836.             ___________
  2837.  
  2838.                  boolean
  2839.  
  2840.  
  2841.  
  2842.             REMARKS
  2843.             REMARKS
  2844.             _______
  2845.  
  2846.             Returns TRUE if successful. Note that this does not
  2847.             guarantee that the character has been sent, only that no
  2848.             errors were detected. Returns FALSE if the port is not
  2849.             active, or if there no room in the port's buffer.
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.                                       Page 39
  2876.                   CopyRight (c) 1988 Information Technology, Ltd.
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2884.                         for Microsoft, Datalight and Turbo C
  2885.  
  2886.            _______________________________________________________________
  2887.            _______________________________________________________________
  2888.  
  2889.                GetStream function                            LctSupp
  2890.                GetStream function                            LctSupp
  2891.            _______________________________________________________________
  2892.            _______________________________________________________________
  2893.  
  2894.  
  2895.             FUNCTION
  2896.             FUNCTION
  2897.             ________
  2898.  
  2899.                  Gets a stream of N characters from the port's
  2900.                  input buffer
  2901.  
  2902.  
  2903.             DECLARATION
  2904.             DECLARATION
  2905.             ___________
  2906.  
  2907.             GetStream(CPort:integer; var Buff; BCnt:integer)
  2908.  
  2909.  
  2910.  
  2911.             RESULT TYPE
  2912.             RESULT TYPE
  2913.             ___________
  2914.  
  2915.                  integer
  2916.  
  2917.  
  2918.  
  2919.             REMARKS
  2920.             REMARKS
  2921.             _______
  2922.  
  2923.             Reads a stream of, at most, BCnt characters from the serial
  2924.             port's input buffer into the Buff array. Returns the count
  2925.             of characters actually transferred, or -1 if an error
  2926.             occurs. NOTE that Buff is an array of characters or bytes,
  2927.             not a string, although you may treat a string variable like
  2928.             an array, as shown below.
  2929.  
  2930.  
  2931.  
  2932.             EXAMPLE
  2933.             EXAMPLE
  2934.             _______
  2935.  
  2936.                  Type
  2937.                     MaxStr = string[256];
  2938.                     
  2939.                     Var
  2940.                       StrBuff : MaxStr;
  2941.                       RecdLen : integer;
  2942.                     
  2943.                     begin
  2944.                       RecdLen := GetStream(2, StrBuff[1], 256);
  2945.                       if RecdLen <= 0 then     { error or no char }
  2946.                         StrBuff[0] := 0
  2947.                       else
  2948.                         StrBuff[0] := Chr(RecdLen);
  2949.                     end;
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.                                       Page 40
  2956.                   CopyRight (c) 1988 Information Technology, Ltd.
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  2964.                         for Microsoft, Datalight and Turbo C
  2965.  
  2966.            _______________________________________________________________
  2967.            _______________________________________________________________
  2968.  
  2969.                PutStream function                            LctSupp
  2970.                PutStream function                            LctSupp
  2971.            _______________________________________________________________
  2972.            _______________________________________________________________
  2973.  
  2974.  
  2975.             FUNCTION
  2976.             FUNCTION
  2977.             ________
  2978.  
  2979.             Places a stream of, at most, N characters in the port's
  2980.             transmit buffer.
  2981.  
  2982.  
  2983.  
  2984.             DECLARATION
  2985.             DECLARATION
  2986.             ___________
  2987.  
  2988.             PutStream(CPort:integer; var Buff; BCnt:integer)
  2989.  
  2990.  
  2991.  
  2992.             RESULT TYPE
  2993.             RESULT TYPE
  2994.             ___________
  2995.  
  2996.                  integer
  2997.  
  2998.  
  2999.  
  3000.             REMARKS
  3001.             REMARKS
  3002.             _______
  3003.  
  3004.             Buff is an array of character or byte, not a string,
  3005.             although it is possible to specify a string variable, using
  3006.             the same approach as outlined for the GetStream function.
  3007.             PutStream returns the number of characters actually placed
  3008.             into the buffer. Note that this does not guarantee that the
  3009.             characters have been sent. A value of 0 will be returned if
  3010.             any error occurs, or if there no room in the port's buffer.
  3011.  
  3012.  
  3013.  
  3014.             SEE ALSO
  3015.             SEE ALSO
  3016.             ________
  3017.  
  3018.                  PutStream
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.                                       Page 41
  3036.                   CopyRight (c) 1988 Information Technology, Ltd.
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3044.                         for Microsoft, Datalight and Turbo C
  3045.  
  3046.            _______________________________________________________________
  3047.            _______________________________________________________________
  3048.  
  3049.                Buffer Flushing functions                     LctSupp
  3050.                Buffer Flushing functions                     LctSupp
  3051.            _______________________________________________________________
  3052.            _______________________________________________________________
  3053.  
  3054.  
  3055.             FUNCTION
  3056.             FUNCTION
  3057.             ________
  3058.  
  3059.             Provides several high level buffer management functions to
  3060.             control the contents of the port's transmit and receive
  3061.             buffers
  3062.  
  3063.  
  3064.  
  3065.             DELCLARATION
  3066.             DELCLARATION
  3067.             ____________
  3068.  
  3069.             function PurgeTxBuff(CPort:integer)
  3070.             
  3071.             function PurgeRxBuff(CPort:integer)
  3072.             
  3073.             procedure FlushUntilMatch(CPort:integer; Ch:byte)
  3074.             
  3075.             procedure FlushNBytes(CPort:integer; N:integer);
  3076.  
  3077.  
  3078.  
  3079.             RESULT TYPE
  3080.             RESULT TYPE
  3081.             ___________
  3082.  
  3083.                  boolean for PurgeTxBuff, PurgeRxBuff
  3084.  
  3085.  
  3086.  
  3087.             REMARKS
  3088.             REMARKS
  3089.             _______
  3090.  
  3091.             The PurgeRxBuff and PurgeTxBuff functions remove all
  3092.             characters from the port's receive and transmit buffers
  3093.             respectively and discard them; untransmitted characters in
  3094.             the transmit buffer are NEVER sent; unprocessed characters
  3095.             in the receive buffer are lost.  Both functions return a
  3096.             value of TRUE if no errors were encountered, FALSE
  3097.             otherwise.  An empty buffer is NOT considered an error.
  3098.  
  3099.  
  3100.             The FlushUntilMatch procedure will continually dispose of
  3101.             received characters until the character Ch is received. The
  3102.             procedure will return when the character Ch is detected, or
  3103.             when there are no more characters in the port's input
  3104.             buffer.
  3105.  
  3106.  
  3107.             The FlushNBytes procedure removes, at most, N characters
  3108.             from the port's receive buffer.
  3109.  
  3110.  
  3111.  
  3112.  
  3113.                                       Page 42
  3114.                   CopyRight (c) 1988 Information Technology, Ltd.
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3122.                         for Microsoft, Datalight and Turbo C
  3123.  
  3124.            _______________________________________________________________
  3125.            _______________________________________________________________
  3126.  
  3127.                SendBreak function                            LctKrnl
  3128.                SendBreak function                            LctKrnl
  3129.            _______________________________________________________________
  3130.            _______________________________________________________________
  3131.  
  3132.  
  3133.             FUNCTION
  3134.             FUNCTION
  3135.             ________
  3136.  
  3137.             Send a true Break signal
  3138.  
  3139.  
  3140.  
  3141.             DECLARATION
  3142.             DECLARATION
  3143.             ___________
  3144.  
  3145.             SendBreak(CPort:integer)
  3146.  
  3147.  
  3148.  
  3149.             RESULT TYPE
  3150.             RESULT TYPE
  3151.             ___________
  3152.  
  3153.                  boolean
  3154.  
  3155.  
  3156.  
  3157.             REMARKS
  3158.             REMARKS
  3159.             _______
  3160.  
  3161.             SendBreak generates a BREAK signal using a particular
  3162.             characteristic of the 8250 UART to generate an accurate
  3163.             BREAK at any baud rate.  BREAKS generated in this manner are
  3164.             timed based upon the baud rate at which the 8250 is
  3165.             currently initialized.  This function may or may not work
  3166.             correctly with other than the actual 8250 UART.
  3167.  
  3168.  
  3169.             Returns TRUE if successful. Returns FALSE if an error is
  3170.             detected.
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.                                       Page 43
  3192.                   CopyRight (c) 1988 Information Technology, Ltd.
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3200.                         for Microsoft, Datalight and Turbo C
  3201.  
  3202.            _______________________________________________________________
  3203.            _______________________________________________________________
  3204.  
  3205.                HAYES MODEM FUNCTIONS                        LctHayes
  3206.                HAYES MODEM FUNCTIONS                        LctHayes
  3207.            _______________________________________________________________
  3208.            _______________________________________________________________
  3209.  
  3210.  
  3211.             FUNCTION
  3212.             FUNCTION
  3213.             ________
  3214.  
  3215.             Provides support for various aspects of modems the support
  3216.             the Hayes(tm) command set.
  3217.  
  3218.  
  3219.  
  3220.             DECLARATIONS
  3221.             DECLARATIONS
  3222.             ____________
  3223.  
  3224.             CONST
  3225.               NUMRES = 0     { numeric result codes}
  3226.               WRDRES = 1     { word result codes }
  3227.               SPKOFF = 0     { speaker off }
  3228.               SPKON  = 1     { speaker on until CD }
  3229.               SPKSPC = 2     { speaker always on }
  3230.               ONHK   = 0     { go on-hook (hang up) }
  3231.               OFFHK  = 1     { go off-hook (lift receiver) }
  3232.               OFFHKS = 2     { go off-hook, don't close relay }
  3233.               BASIC  = 0     { basic result set }
  3234.               EXSET1 = 1     { extended results, set 1 }
  3235.               EXSET3 = 2     { extended results, set 3 }
  3236.               EXSET4 = 3     { extended results, set 4 }
  3237.             
  3238.  
  3239.  
  3240.             TYPE
  3241.               TelNumStr = string[20];
  3242.             
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.                                       Page 44
  3266.                   CopyRight (c) 1988 Information Technology, Ltd.
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3274.                         for Microsoft, Datalight and Turbo C
  3275.  
  3276.             procedure SetType(NType : byte)
  3277.             
  3278.             procedure SetSet(NSet : byte)
  3279.             
  3280.             function RetType : byte
  3281.             
  3282.             function RetSet : byte
  3283.             
  3284.             function ModemCodesOn(CPort : integer):boolean
  3285.             
  3286.             function ModemCodesOff(CPort : integer):boolean
  3287.             
  3288.             function ModemWordResponse(CPort : integer):boolean
  3289.             
  3290.             function ModemDigitResponse(CPort : integer):boolean
  3291.             
  3292.             function RepeatModemCommand(CPort : integer):boolean
  3293.             
  3294.             function ModemSpeaker(CPort : integer; Mode : byte):boolean
  3295.             
  3296.             function SetModemRegister(CPort, Reg, NValue : integer) :
  3297.             boolean
  3298.             
  3299.             function GetModemRegister(CPort, Reg, NValue : integer) :
  3300.             boolean
  3301.             
  3302.             function ModemHalfDuplex(CPort : integer) : boolean
  3303.             
  3304.             function ModemFullDuplex(CPort : integer) : boolean
  3305.             
  3306.             function ModemEchoCmd(CPort : integer) : boolean
  3307.             
  3308.             function ModemNoEchoCmd(CPort : integer) : boolean
  3309.             
  3310.             function ModemHookMode(CPort : integer; HMode : byte) :
  3311.             boolean
  3312.             
  3313.             function ModemCarrierOn(CPort : integer) : boolean
  3314.             
  3315.             function ModemCarrierOff(CPort : integer) : boolean
  3316.             
  3317.             function ModemWordResponse(CPort : integer):boolean
  3318.             
  3319.             function ModemDigitResponse(CPort : integer):boolean
  3320.             
  3321.             function RepeatModemCommand(CPort : integer):boolean
  3322.             
  3323.             function ModemSpeaker(CPort : integer; Mode : byte):boolean
  3324.             
  3325.             function SetModemRegister(CPort, Reg, NValue : integer) :
  3326.             boolean
  3327.             
  3328.             function GetModemRegister(CPort, Reg, NValue : integer) :
  3329.             boolean
  3330.             
  3331.                                       Page 45
  3332.                   CopyRight (c) 1988 Information Technology, Ltd.
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3340.                         for Microsoft, Datalight and Turbo C
  3341.  
  3342.             function ModemHalfDuplex(CPort : integer) : boolean
  3343.             
  3344.             function ModemFullDuplex(CPort : integer) : boolean
  3345.             
  3346.             function ModemEchoCmd(CPort : integer) : boolean
  3347.             
  3348.             function ModemNoEchoCmd(CPort : integer) : boolean
  3349.             
  3350.             function ModemHookMode(CPort : integer; HMode : byte) :
  3351.             boolean
  3352.             
  3353.             function ModemCarrierOn(CPort : integer) : boolean
  3354.             
  3355.             function ModemCarrierOff(CPort : integer) : boolean
  3356.             
  3357.             function ModemCodeSet(CPort : integer; NewSet : byte) :
  3358.             boolean
  3359.             
  3360.             function ModemPulse(CPort : integer) : boolean
  3361.             
  3362.             function ModemTone(CPort : integer) : boolean
  3363.             
  3364.             function ModemDial(CPort : integer; TelNo : TelNumStr) :
  3365.             boolean
  3366.  
  3367.  
  3368.  
  3369.             REMARKS
  3370.             REMARKS
  3371.             _______
  3372.  
  3373.             The ModemCodeSet function allows you to change the set of
  3374.             codes that are returned by the modem when an action is
  3375.             specified.
  3376.  
  3377.  
  3378.             ModemDial instructs the modem to dial the number contained
  3379.             in TelNo. Do not include the dialing (ATD) prefix, or the
  3380.             trailing <CR>. These are provided by the function. You may
  3381.             include non-numeric characters as the contents of TelNo are
  3382.             not checked. The dialing is done in the last known, pulse or
  3383.             tone, mode. If you use the MpdemPulse or ModemTone
  3384.             functions, then dialing will be done in the mode that was
  3385.             last correctly enabled. If you have not exercised these
  3386.             functions, then dialing occurs in the modems default or
  3387.             power-up mode.
  3388.  
  3389.  
  3390.             The ModemHalfDuplex and ModemFullDuplex functions place the
  3391.             modem into local echo and remote echo modes respectively.
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.                                       Page 46
  3400.                   CopyRight (c) 1988 Information Technology, Ltd.
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3408.                         for Microsoft, Datalight and Turbo C
  3409.  
  3410.             The GetModemRegister function requests that the modem return
  3411.             the current value of S-register Reg. Reg must be in the
  3412.             range 0 to 13. Use the GetStream, or similar function, to
  3413.             retrieve the modem's response. Specifying a register outside
  3414.             the 0 to 13 range will cause a return of FALSE.
  3415.  
  3416.  
  3417.             SetModemRegister is the companion to GetModemRegister, with
  3418.             the same restrictions. Sets the S-register Reg to the value
  3419.             contained in NValue. If NValue contains -1, then the
  3420.             register is reset to its default (power-up) value. The
  3421.             function checks the value to be certain that it is within
  3422.             the limits specified for the particular register, and
  3423.             returns a value of FALSE if the value is outside the
  3424.             predefined limits.
  3425.  
  3426.  
  3427.             ModemCarrierOff enables modem carrier detect, but disables
  3428.             the modems carrier signal. The ModemCarrierOn companion
  3429.             enables both carrier detect and the modems carrier signal.
  3430.             When ModemCarrierOff is used the modem will receive data but
  3431.             will be unable to send data.
  3432.  
  3433.  
  3434.             The ModemNoEchoCmd and ModemEchoCmd functions determine
  3435.             whether commands sent to the modem are echoed back to the
  3436.             sending program. With echo turned off, the modem will
  3437.             continue to accept commands, but will not try to redisplay
  3438.             the command's characters.
  3439.  
  3440.  
  3441.             ModemHookMode allows you to control the current status of
  3442.             the modem's telephone line connection. See your modem's
  3443.             documentation and the above constants for additional
  3444.             information.
  3445.  
  3446.  
  3447.             The ModemRepeatCommand function instructs the modem to
  3448.             repeat the last command sequence executed. Generally, this
  3449.             function is of greatest value in re-dialing numbers that are
  3450.             busy, although its use is not restricted to that.
  3451.  
  3452.  
  3453.             The way in which your modem responds to commands is
  3454.             determined, in part, by the ModemWordResponse and
  3455.             ModemDigitResponse functions. If you call ModemWordResponse,
  3456.             then modem responses use the English language response
  3457.             codes, e.g. CONNECT or OK. Calling ModemDigitResponse
  3458.             instructs the modem to respond with code numbers only from
  3459.             the currently selected response set, see the ModemCodeSet
  3460.             function above.
  3461.  
  3462.  
  3463.  
  3464.  
  3465.                                       Page 47
  3466.                   CopyRight (c) 1988 Information Technology, Ltd.
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3474.                         for Microsoft, Datalight and Turbo C
  3475.  
  3476.             You may use the functions ModemCodesOn and ModemCodesOff to
  3477.             specify whether you want your modem to send back response
  3478.             codes when it receives a command string. In a sense, these
  3479.             act as companions to the EchoCmd functions above.
  3480.  
  3481.  
  3482.             Use the ModemSpeaker function to control the modem's
  3483.             internal speaker, if it has one. See the above constants for
  3484.             the applicable codes.
  3485.  
  3486.  
  3487.             The RetSet and RetType functions return, respectively, the
  3488.             last known command set (ModemCodeSet) and last known result
  3489.             type (ModemWordResponse, ModemDigitResponse). The RetSet and
  3490.             RetType  functions are only of value when used in
  3491.             conjunction with the companion functions.
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.                                       Page 48
  3532.                   CopyRight (c) 1988 Information Technology, Ltd.
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3540.                         for Microsoft, Datalight and Turbo C
  3541.  
  3542.             GENERAL REMARKS
  3543.             GENERAL REMARKS
  3544.             _______________
  3545.  
  3546.  
  3547.             Several considerations are in order if you intend to use the
  3548.             Hayes ToolBox functions.
  3549.  
  3550.  
  3551.  
  3552.                 1. You are responsible for checking the return
  3553.                    codes from the modem once you have given modem a
  3554.                    command. To make the task easier, we suggest
  3555.                    that you turn OFF command echo (so that you
  3556.                    don't have to worry about separating commands
  3557.                    from responses) and turn ON numeric responses
  3558.                    (to make the interpretation of result codes
  3559.                    easier and faster).
  3560.  
  3561.  
  3562.                 2. Be sure that you allow  adequate time between
  3563.                    commands for the modem to process the command
  3564.                    and respond. Failure to observe this rule may
  3565.                    result in commands being misinterpreted or
  3566.                    "lost". You can monitor the number of characters
  3567.                    in the receive buffer to help you with the
  3568.                    timing. Or alternatively, check the response
  3569.                    after each command. The latter approach is more
  3570.                    in line with what we believe to be good
  3571.                    programming practice.
  3572.  
  3573.  
  3574.             RETURN VALUES
  3575.             RETURN VALUES
  3576.             _____________
  3577.  
  3578.             All functions return a value of FALSE if a port or other
  3579.             error is detected, TRUE otherwise.
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.                                       Page 49
  3602.                   CopyRight (c) 1988 Information Technology, Ltd.
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.                       LITECOMM-TP (tm) COMMUNICATIONS TOOLBOX
  3610.                         for Microsoft, Datalight and Turbo C
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.                                       Page 50
  3668.                   CopyRight (c) 1988 Information Technology, Ltd.
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.                            LITECOMM-TP REGISTRATION FORM
  3677.                            LITECOMM-TP REGISTRATION FORM
  3678.                            _____________________________
  3679.  
  3680.             Please complete the following information. Note that the
  3681.             prices below are for a single-use registration only. Please
  3682.             contact us directly for site licensing.
  3683.  
  3684.             Mail to:
  3685.                  Information Technology
  3686.                  PO Box 554
  3687.                  Coventry, RI 02816
  3688.                  Telephone Orders or Information (401) 826-2223
  3689.             ┌──────────────────────────────────────────────────────────┐
  3690.             │ SHIP TO:                                                 │
  3691.             │ Name    ________________________________________         │
  3692.             │                                                          │
  3693.             │ Company ________________________________________         │
  3694.             │                                                          │
  3695.             │ Street  ________________________________________         │
  3696.             │                                                          │
  3697.             │         ________________________________________         │
  3698.             │                                                          │
  3699.             │ City    ___________________  State __  Zip _____         │
  3700.             │                                                          │
  3701.             │ Telephone _______________________                        │
  3702.             ├─────┬──────────┬───────────────────┬─────────────────────┤
  3703.             │     │          │                   │                     │
  3704.             │ QTY │          │ REGISTRATION TYPE │ REGISTRATION FEE    │
  3705.             │     │          │                   │                     │
  3706.             ├─────┼──────────┼───────────────────┼─────────────────────┤
  3707.             │     │          │                   │                     │
  3708.             │     │   BOTH   │ LIBRARIES @ $30   │                     │
  3709.             │     │ INCLUDE  │                   │                     │
  3710.             ├─────┼          ┼───────────────────┼─────────────────────┤
  3711.             │     │ PRINTED  │                   │                     │
  3712.             │     │ MANUAL   │ LIBRARIES AND     │                     │
  3713.             │     │          │ SOURCE  @ $55     │                     │
  3714.             │     │          │                   │                     │
  3715.             ├─────┼──────────┼───────────────────┼─────────────────────┤
  3716.             │     │          │                   │                     │
  3717.             │     │          │ RI Sales Tax 6%   │                     │
  3718.             │     │          │                   │                     │
  3719.             └─────┴──────────┴───────────────────┴─────────────────────┘
  3720.             Method of Payment (Check, Mastercard, Visa) _____________
  3721.             
  3722.                  Credit Card Number __________________________
  3723.             
  3724.                  Expiration Date __________________________
  3725.             
  3726.                  Name as it appears on card ___________________________
  3727.             
  3728.                  Signature for MC/VISA ________________________________
  3729.             
  3730.             All MasterCard/Visa orders must include a telephone number,
  3731.             
  3732.             We regret that we cannot accept COD orders
  3733.            _______________________________________________________________
  3734.             (office use only)
  3735.                 Date Received ______________ Date Sent _____________
  3736.                 Version ______________ Serial Number _______________
  3737.  
  3738.  
  3739.  
  3740.