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

📄 modem.h

📁 开源代码的pwlib的1.10.0版本,使用openh323的1.18.0版本毕备
💻 H
📖 第 1 页 / 共 2 页
字号:
       @return
       TRUE if command string sent successfully and the objects state has
       changed.
     */
    BOOL Deinitialise();

    /** Set the modem pre-dial 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 SetPreDialString(
      const PString & str   ///< New pre-dial command string.
    );

    /** Get the modem pre-dial meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for pre-dial command.
     */
    PString GetPreDialString() const;

    /** Set the modem post-dial meta-command string.

       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       Note there is <EM>not</EM> an implied <CODE>\s</CODE> before the
       string, unlike the pre-dial string.
     */
    void SetPostDialString(
      const PString & str   ///< New post-dial command string.
    );

    /** Get the modem post-dial meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for post-dial command.
     */
    PString GetPostDialString() const;

    /** Set the modem busy response 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>\w120s</CODE> before the string. Also
       the <CODE>\s</CODE> and <CODE>\d</CODE> commands do not operate and
       will simply terminate the string match.
     */
    void SetBusyString(
      const PString & str   ///< New busy response command string.
    );

    /** Get the modem busy response meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for busy response command.
     */
    PString GetBusyString() const;

    /** Set the modem no carrier response 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>\w120s</CODE> before the string. Also
       the <CODE>\s</CODE> and <CODE>\d</CODE> commands do not operate and
       will simply terminate the string match.
     */
    void SetNoCarrierString(
      const PString & str   ///< New no carrier response command string.
    );

    /** Get the modem no carrier response meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for no carrier response command.
     */
    PString GetNoCarrierString() const;

    /** Set the modem connect response 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>\w120s</CODE> before the string. Also
       the <CODE>\s</CODE> and <CODE>\d</CODE> commands do not operate and
       will simply terminate the string match.
     */
    void SetConnectString(
      const PString & str   ///< New connect response command string.
    );

    /** Get the modem connect response meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for connect response command.
     */
    PString GetConnectString() const;

    /** The modem is in a state that allows the dial to start.
    
       @return
       TRUE if the <A>Dial()</A> function may proceeed.
     */
    BOOL CanDial() const;

    /** Send the dial meta-command strings 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.

       The string sent to the modem is the concatenation of the pre-dial
       string, a <CODE>\s</CODE>, the <CODE>number</CODE> parameter and the
       post-dial string.

       @return
       TRUE if command string sent successfully and the objects state has
       changed.
     */
    BOOL Dial(const PString & number);

    /** Set the modem hang up 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 SetHangUpString(
      const PString & str   ///< New hang up command string.
    );

    /** Get the modem hang up meta-command string.
    
       See the <A>PChannel::SendCommandString()</A> function for more
       information on the format of the command string.

       @return
       string for hang up command.
     */
    PString GetHangUpString() const;

    /** The modem is in a state that allows the hang up to start.
    
       @return
       TRUE if the <A>HangUp()</A> function may proceeed.
     */
    BOOL CanHangUp() const;

    /** Send the hang up 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 HangUp();

    /** The modem is in a state that allows the user command to start.
    
       @return
       TRUE if the <A>SendUser()</A> function may proceeed.
     */
    BOOL CanSendUser() const;

    /** Send an arbitrary user 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.
     */
    BOOL SendUser(
      const PString & str   ///< User command string to send.
    );

    void Abort();
    // Abort the current meta-string command operation eg dial, hang up etc.

    /** The modem is in a state that allows the user application to read from
       the channel. Reading while this is TRUE can interfere with the operation
       of the meta-string processing. This function is only usefull when
       multi-threading is used.

       @return
       TRUE if <A>Read()</A> operations are "safe".
     */
    BOOL CanRead() const;

    enum Status {
      Unopened,           ///< Has not been opened yet
      Uninitialised,      ///< Is open but has not yet been initialised
      Initialising,       ///< Is currently initialising the modem
      Initialised,        ///< Has been initialised but is not connected
      InitialiseFailed,   ///< Initialisation sequence failed
      Dialling,           ///< Is currently dialling
      DialFailed,         ///< Dial failed
      AwaitingResponse,   ///< Dialling in progress, awaiting connection
      LineBusy,           ///< Dial failed due to line busy
      NoCarrier,          ///< Dial failed due to no carrier
      Connected,          ///< Dial was successful and modem has connected
      HangingUp,          ///< Is currently hanging up the modem
      HangUpFailed,       ///< The hang up failed
      Deinitialising,     ///< is currently de-initialising the modem
      DeinitialiseFailed, ///< The de-initialisation failed
      SendingUserCommand, ///< Is currently sending a user command
      NumStatuses
    };
    // Modem object states.

    /** Get the modem objects current state.

       @return
       modem status.
     */
    Status GetStatus() const;


  protected:
    // Member variables
    PString initCmd, deinitCmd, preDialCmd, postDialCmd,
            busyReply, noCarrierReply, connectReply, hangUpCmd;
      // Modem command meta-strings.

    Status status;
      // Current modem status
};


// End Of File ///////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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