/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*  MODEM.HPP                          by Alan Partis, Copyright (C)         */
/*                                     International Trade Systems, Inc.     */
/*                                     1993 All rights reserved.             */
/*                                                                           */
/*  Description:   Class definition for the Modem class.                     */
/*                                                                           */
/*  Contents:      Modem                                                     */
/*                                                                           */
/*  Date      Initials  Comments                                             */
/*  -----------------------------------------------------------------------  */
/*  05 Sep 93 acp       Initial Creation                                     */
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef  _MODEM_HPP
#define  _MODEM_HPP

//
// supporting types and constants
//
#define  COM1           0
#define  COM2           1
#define  COM3           2
#define  COM4           3
#define  COM_8N1        _COM_CHR8 | _COM_NOPARITY | _COM_STOP1

// ----- stats bits
#define  COM_TIMEOUT    0x8000
#define  COM_TSR_EMPTY  0x4000
#define  COM_THR_EMPTY  0x2000
#define  COM_DSR        0x0020
#define  COM_CTS        0x0010

// ----- baud rates
#define  COM_300        300
#define  COM_1200       1200
#define  COM_2400       2400
#define  COM_4800       4800
#define  COM_7200       7200
#define  COM_9600       9600
#define  COM_14400      14400

// ----- modem control bits
#define  MC_DTR        0x01
#define  MC_RTS        0x02
#define  MC_OUT1       0x04
#define  MC_OUT2       0x08
#define  MC_LOOP       0x10


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*  Modem                              by Alan Partis, Copyright (C)         */
/*                                     International Trade Systems, Inc.     */
/*                                     1993 All rights reserved.             */
/*                                                                           */
/*  Description:   Class defining the behavior of a Modem.                   */
/*                                                                           */
/*  Parents:       none                                                      */
/*                                                                           */
/*  Public Members:     Modem()                                              */
/*                     ~Modem()                                              */
/*                      Init()         access target modem                   */
/*                                                                           */
/*  Date      Initials  Comments                                             */
/*  -----------------------------------------------------------------------  */
/*  05 Sep 93 acp       Initial Creation                                     */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class Modem
{
    private:

    protected:
         int       port;               //port being used - COM1=0, COM2=1, ...
         word      address;            //I/O address of port

         //
         // protected member functions
         //
         int       IsModem();
         void      SendATCmd(char *DTA);
         void      SetDSR();


    public:
         //
         // constructor/deconstructor
         //
         Modem();
        ~Modem();

         //
         // class member functions
         //
         int       Init(int Port, word Address);

};  /* end of class Modem */

#endif


  Copyright © Thundernet Development Group Inc., 2003.
All rights reserved.