home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / LITECOMM / LC.DOC next >
Text File  |  1993-12-01  |  113KB  |  4,159 lines

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