home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ISC366.ZIP / SERIAL / MODEM.H < prev    next >
Text File  |  1993-09-01  |  3KB  |  74 lines

  1. ///////////////////////////////////////////////////////////////////////////
  2. //                                                                       //
  3. //            File: modem.h                                              //
  4. //            started on: 23/2/92                                        //
  5. //                                                                       //
  6. ///////////////////////////////////////////////////////////////////////////
  7. //                                                                       //
  8. //  This class submits to DSR and CTS requests and so is compatible      //
  9. //  with modems. Useful for hardware flow control, also... It also       //
  10. //  transmits MODEM init and hangup strings.                             //
  11. //                                                                       //
  12. ///////////////////////////////////////////////////////////////////////////
  13. //                                                                       //
  14. //                    by Ofer Laor (AKA LeucroTTA)                       //
  15. //                                                                       //
  16. ///////////////////////////////////////////////////////////////////////////
  17.  
  18. #ifndef __MODEM_H
  19. #define __MODEM_H
  20.  
  21. #include "serial.h" ; // SERIAL_PORT
  22.  
  23. class MODEM: public SERIAL_PORT {
  24.  
  25.  
  26. protected:
  27.  
  28.        // overloads the msr_int from serial_port.
  29.        //
  30.        virtual void msr_int(const BYTE msr);
  31.  
  32.        // overloads the extended init (called by activate!).
  33.        //
  34.        virtual void extended_init();
  35.  
  36.        // overloads the flow control function.
  37.        //
  38.        virtual inline void flow_check();
  39.  
  40.        // called by msr_int when a ring is indicated.
  41.        //
  42.        virtual void ring_int(BYTE msr);
  43.  
  44.        // called by msr_int when a modem status is indicated (DSR, CTS).
  45.        //
  46.        virtual void modem_status_change(BYTE msr);
  47.  
  48.        // called by msr_int when DCD changes (up or down).
  49.        //
  50.        virtual void dcd_status_change(BYTE msr);
  51.  
  52. public:
  53.        MODEM(): SERIAL_PORT() {};
  54.        ~MODEM();
  55.  
  56.        // called to enquire as to the state of the modem.
  57.        //
  58.        BYTE get_MSR();
  59.  
  60.        // this function is called to disconnect from the modem.
  61.        //
  62.        virtual void disconnect( BOOLEAN boot_enable= TRUE,
  63.                                 const char *escape_sequence= "",
  64.                                 const char *disconnect_string= "",
  65.                                 const char *disconnect_reply_string= "",
  66.                                 const unsigned timeout= 0);
  67.  
  68.        // wait until DCD is down/ timout expired.
  69.        virtual void wait(unsigned miliseconds);
  70.  
  71. };
  72.  
  73. #endif
  74.