⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modem.h

📁 mgcp协议源代码。支持多种编码:g711
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * modem.h * * AT command set modem on asynchonous port class. * * Portable Windows Library * * Copyright (c) 1993-1998 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Portable Windows Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Portions are Copyright (C) 1993 Free Software Foundation, Inc. * All Rights Reserved. * * Contributor(s): ______________________________________. * * $Log: modem.h,v $ * Revision 1.12  1999/03/09 08:01:46  robertj * Changed comments for doc++ support (more to come). * * Revision 1.11  1999/02/16 08:07:10  robertj * MSVC 6.0 compatibility changes. * * Revision 1.10  1998/12/02 03:51:39  robertj * Unix compatibility changes * * Revision 1.9  1998/09/23 06:20:53  robertj * Added open source copyright license. * * Revision 1.8  1995/06/17 11:12:46  robertj * Documentation update. * * Revision 1.7  1995/03/14 12:41:51  robertj * Updated documentation to use HTML codes. * * Revision 1.6  1995/01/06  10:31:02  robertj * Documentation. * * Revision 1.5  1994/08/23  11:32:52  robertj * Oops * * Revision 1.4  1994/08/22  00:46:48  robertj * Added pragma fro GNU C++ compiler. * * Revision 1.3  1994/08/21  23:43:02  robertj * Moved meta-string transmitter from PModem to PChannel. * * Revision 1.2  1994/07/25  03:32:29  robertj * Fixed bug in GCC with enums. * * Revision 1.1  1994/06/25  11:55:15  robertj * Initial revision * */#define _PMODEM#ifdef __GNUC__#pragma interface#endif#ifndef _PSERIALCHANNEL#include <ptlib/serchan.h>#endif/** A class representing a modem attached to a serial port. This adds the usual   modem operations to the basic serial port.      A modem object is always in a particular state. This state determines what   operations are allowed which then move the object to other states. The   operations are the exchange of strings in "chat" script.      The following defaults are used for command strings:       initialise         <CODE>ATZ\r\w2sOK\w100m</CODE>       deinitialise       <CODE>\d2s+++\d2sATH0\r</CODE>       pre-dial           <CODE>ATDT</CODE>       post-dial          <CODE>\r</CODE>       busy reply         <CODE>BUSY</CODE>       no carrier reply   <CODE>NO CARRIER</CODE>       connect reply      <CODE>CONNECT</CODE>       hang up            <CODE>\d2s+++\d2sATH0\r</CODE> */class PModem : public PSerialChannel{  PCLASSINFO(PModem, PSerialChannel)  public:    /** Create a modem object on the serial port specified. If no port was       specified do not open it. It does not initially have a valid port name.              See the <A>PSerialChannel</A> class for more information on the       parameters.     */    PModem();    PModem(      const PString & port,   // Serial port name to open.      DWORD speed = 0,        // Speed of serial port.      BYTE data = 0,          // Number of data bits for serial port.      Parity parity = DefaultParity,  // Parity for serial port.      BYTE stop = 0,          // Number of stop bits for serial port.      FlowControl inputFlow = DefaultFlowControl,   // Input flow control.      FlowControl outputFlow = DefaultFlowControl   // Output flow control.    );    /** Open the modem serial channel obtaining the parameters from standard       variables in the configuration file. Note that it assumed that the       correct configuration file section is already set.     */    PModem(      PConfig & cfg   // Configuration file to read parameters from.    );  // Overrides from class PChannel    virtual BOOL Close();    // Close the modem serial port channel.  // Overrides from class PSerialChannel    /** Open the modem serial channel on the specified port.              See the <A>PSerialChannel</A> class for more information on the       parameters.              @return       TRUE if the modem serial port was successfully opened.     */    virtual BOOL Open(      const PString & port,   // Serial port name to open.      DWORD speed = 0,        // Speed of serial port.      BYTE data = 0,          // Number of data bits for serial port.      Parity parity = DefaultParity,  // Parity for serial port.      BYTE stop = 0,          // Number of stop bits for serial port.      FlowControl inputFlow = DefaultFlowControl,   // Input flow control.      FlowControl outputFlow = DefaultFlowControl   // Output flow control.    );    /** Open the modem serial port obtaining the parameters from standard       variables in the configuration file. Note that it assumed that the       correct configuration file section is already set.       @return       TRUE if the modem serial port was successfully opened.     */    virtual BOOL Open(      PConfig & cfg   // Configuration file to read parameters from.    );    virtual void SaveSettings(      PConfig & cfg   // Configuration file to write parameters to.    );    // Save the current modem serial port settings into the configuration file.  // New member functions    /** Set the modem initialisation meta-command string.       See the <A>PChannel::SendCommandString()</A> function for more       information on the format of the command string.       Note there is an implied <CODE>\s</CODE> before the string.     */    void SetInitString(      const PString & str   // New initialisation command string.    );    /** Get the modem initialisation meta-command string.           See the <A>PChannel::SendCommandString()</A> function for more       information on the format of the command string.       @return       string for initialisation command.     */    PString GetInitString() const;    /** The modem is in a state that allows the initialise to start.           @return       TRUE if the <A>Initialise()</A> function may proceeed.     */    BOOL CanInitialise() const;    /** Send the initialisation meta-command string to the modem. The return       value indicates that the conditions for the operation to start were met,       ie the serial port was open etc and the command was successfully       sent with all replies met.       @return       TRUE if command string sent successfully and the objects state has       changed.     */    BOOL Initialise();    /** Set the modem de-initialisation meta-command string.       See the <A>PChannel::SendCommandString()</A> function for more       information on the format of the command string.       Note there is an implied <CODE>\s</CODE> before the string.     */    void SetDeinitString(      const PString & str   // New de-initialisation command string.    );    /** Get the modem de-initialisation meta-command string.           See the <A>PChannel::SendCommandString()</A> function for more       information on the format of the command string.       @return       string for de-initialisation command.     */    PString GetDeinitString() const;    /** The modem is in a state that allows the de-initialise to start.           @return       TRUE if the <A>Deinitialise()</A> function may proceeed.     */    BOOL CanDeinitialise() const;    /** Send the de-initialisation meta-command string to the modem. The return       value indicates that the conditions for the operation to start were met,       ie the serial port was open etc and the command was successfully       sent with all replies met.       @return       TRUE if command string sent successfully and the objects state has       changed.     */    BOOL Deinitialise();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -