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

📄 hayes.txt

📁 使用efax的fax工具程序
💻 TXT
📖 第 1 页 / 共 5 页
字号:
------------------------------------------------------------------------S36      Bit 7-3=0       reserved First    Bit 2 (4)       If set, means try MNP protocol; reset means                          don't use MNP. Third    Bit 1 (2)       If set, means fall back to ASB; reset means                          direct async. Second   Bit 0 (1)       If set, means fall back based on Bit 1;                         reset means hang up.------------------------------------------------------------------------         The following table shows the meaning of each setting:------------------------------------------------------------------------S36=7   Try MNP, then fall back to ASB. S36=6   Try MNP, then hang up. S36=5   Try MNP, then fall back to direct async. S36=4   Try MNP, then hang up. S36=3   Don't try MNP; fall back to ASB. S36=2   Don't try MNP; hang up. S36=1   Don't try MNP; fall back to direct async. S36=0   Don't try MNP; hang up.------------------------------------------------------------------------There are three types of fallback stratagies which Hayes products use.Type 1: Hayes Modem Operation in &Q5 Communications ModeApplies to V-series Smartmodem 2400 up to and including Version 1.3 and V-series Smartmodem 9600 up to and including Version 1.4.Type 2: Hayes Modem Operation in &Q5 Communications ModeApplies to V-series Smartmodem 2400 Version 1.4 and V-series Smartmodem 9600 Versions 1.5 and 1.6.Type 3: Hayes Modem Operation in &Q5 Communications ModeApplies to all V-series products newer than Types 1 and 2 and all OPTIMA and ACCURA EC products. ------------------------------------------------------------------------               ATI3 Response contains...                    V-SERIES SMARTMODEM 2400    V-SERIES SMARTMODEM 9600Type 1         04-00005-10                 04-00015-10               04-00005-11                 04-00015-11               04-00005-12                 04-00015-12               04-00005-13                 04-00015-13                                           04-00015-14Type 2         04-00005-14                 04-00015-15                                           04-00015-16Type 3         Does not contain any        Does not contain any               of the above numbers        any of the above numbers------------------------------------------------------------------------************************************************************************D.4  Connect ProcessingOnce the setup operation has been completed, the commands to establish the connection can be issued. The instruction can be either to originate (using the D command), or to answer (using the A or S0 commands).++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.4.1  Originating a CallIf the D command is issued with the desired phone number, several possible result codes can be returned. The list below outlines some results to expect:Result Code        Meaning------------------------------------------------------------------------NO CARRIER         Connection failedNO ANSWER          No response to '@' dial modifierNO DIALTONE        No dial tone in X4 modeNO ____            Connection failed for some other reasonBUSY               Busy signal detectedCONNECT ____       Connection successful; you may need to change DTE                    speed to the indicated baud rate. (See Wn and S95)CARRIER ____       * DCE carrier speed. (See Wn and S95)PROTOCOL: ____     * Error-correction protocol being used by the modems.                    (See Wn and S95)COMPRESSION:____   Compression technique in use by modems. (See Wn                    and S95)AUTOSTREAM         Autostream technique in use by modems if selected by                    user. (See Wn and S95)------------------------------------------------------------------------Ignore other responses, but continue to wait for CONNECT ___, BUSY, or NO ___ responses. The CARRIER and PROTOCOL results are intermediate results and precede either a CONNECT ____ or NO ____ result. These results are only returned by Hayes modems when configured to use an error-correcting protocol.If you recognize any numeric value for the baud rate after the CONNECT result, you will have a much more robust controller able to handle many situations. You can use the PROTOCOL result to determine if the flow control requested by the &K command is in effect.Note: If you want to manually dial a call and then have the modem connect, enter the command string ATX1D (X1 disables dial tone detection) when you hear the dial tone. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.4.2  Answering a CallThe simplest technique for answering an incoming call is to set S0 and wait for a CONNECT ___ result. You may get several RING results, and possibly a NO CARRIER result if the caller hangs up before connecting. These results should not cause your controller to abort. Continue to wait for a CONNECT result code.If you set S0, you may want to set it back to zero after your controller finishes the call to prevent inadvertent answering when your software is not running. By setting S0 to the number of rings you desire before the modem answers, you utilize the ring detection technology already built into the modem.You should not use the A command to answer after counting RING results because the command may collide with another RING result from the modem and be missed. The RING results may be generated in pairs depending on the ringing cadence of the phone system.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.4.3  Using the CD LineMonitoring the Carrier Detect (CD) line of the RS-232 interface is another technique for carrier detection in answer or originate mode. This assumes that &C1 or the corresponding DIP-switch has been set and the cable is wired properly. Both are risky assumptions. You will have a more robust controller if you use result code scanning rather than the RS-232 lines.If you use CD, you do not know when the modem has given up waiting for the carrier, or why. If the line is busy, you may want to re-try the dial operation. If there is no dial tone, the user needs to know this.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.4.4  Aborting a Connect RequestOnce the D or S0 command has been issued, the modem goes off hook (or may be off hook for S0) and it must be put back on hook (hangPup) before the abort is completed. To abort an in-progress connect command, send any character to the modem. This will typically result in a NO CARRIER response. The result code scanner should be called after the abort character is sent to prevent additional commands from being sent before the controller and the modem are again in sync.Smartcom products send AT<CR> to abort an in-progress connect command. This elicits a result code regardless of whether the modem were off-hook or not. If the modem was off-hook attempting to connect, this will abort the connect operation and return NO CARRIER. If the modem was on-hook in command mode, this simply returns <CR><LF>OK<CR><LF>.************************************************************************D.5  Carrier Loss DetectionYou want your application to be able to detect when the carrier has been lost so you can determine when the connection is complete. You might be unable to put this part of the code in your controller software, since the controller is typically running only during the connect or hang-up process. Once the application has detected the carrier loss event, it can call the modem controller and restore the modem settings.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.5.1  Using the CD lineIf you are confident of the communications environment and cabling requirements, and have access to the RS-232 signal status, then monitoring the CD line is the easiest carrier loss detection method to implement. This requires &C1 to be programmed at setup time, or be stored in the modem as the value recalled on reset or power-up.However, this is the most restrictive and risky choice. It requires a properly wired cable and support of &C1 by the modem's command set or proper DIP-switch settings.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.5.2  Scanning the Incoming Data StreamIn cases where you  cannot depend on 100% Hayes compatibility or want to be independent from the cable wiring, then scanning for the NO CARRIER result code is more reliable. It is also more complex to implement.Typically, at the low-level of the program all received data is retrieved through one subroutine. This subroutine can be augmented or layered to provide the service needed. As data passes through, the last fourteen characters are buffered, typically in a circular buffer. If more data passes in each call, only the last fourteen need to be copied. At a time when the processor is free, such as after 100 ms of idle time or the receive routine has returned no data for 30 to 100 calls, then the buffer is compared against the <CR><LF>NO CARRIER<CR><LF> result code. If a match is found, the carrier lost event is triggered.By only checking when there is idle time, or after no data has been received for a while, you reduce the CPU overhead and ensure that the modem is not falsely triggered when the string is imbedded in an actual data stream.You can also modify the linefeed character by using S4 to a different value such as S4=31 to make the result code sequence more unique. This action, however, affects other result codes generated by the modem.************************************************************************D.6  Escape and Hang UpWhen your controller has been instructed to terminate the connection, you must put the modem back in command state and issue the hang-up (H) command. In addition to hanging-up, you will also want to restore settings you changed to their factory-set values, or issue an ATZ<CR> to undo the effects of your changes. In any case, restoration of the modem settings is necessary even if the connection was terminated due to loss of carrier.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.6.1  Escaping the Modem to Command StateTo escape the modem, the controller must first delay the escape sequence guard time (specified by S12), then issue the escape sequence character three times (specified by S2); then wait for an OK result. Waiting for the result also enforces the required guard time after the escape sequence. Once the OK result is received, the modem has entered command state. The controller can then hang up and restore the modem.The controller software must be sure to wait the required guard time before sending the escape sequence characters. Your controller may have been called just after data was transmitted and, without the delay, your characters will just be sent without triggering the escape sequence recognition process. It is important that the serial transmitter be permitted to be idle for the escape sequence guard time, plus a few extra milliseconds to allow for error, before sending characters.For example, if  S12=10, a delay of at least 200 milliseconds is required before sending the escape sequence characters. After sending the escape sequence characters, the OK result will be received after another 200 millisecond wait. This completes the escape sequence process in slightly over 400 milliseconds. If S12=50 (factory setting) is used, one full second must pass before the characters can be sent, then another second delay must transpire prior to the OK result. This completes the process in slightly over two seconds. For this reason, it is recommended that S12=10 be issued to speed up this process.A delay slightly longer than that stored in S12 should be used to allow for errors in the system clock as well as in the modem clock. 100ms is an adequate safety margin.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++D.6.2  Using DTR to Escape or Hang UpThe DTR RS-232 signal can be used to escape the modem to command state, or to reset the modem depending on the &D command set or DIP-switch settings. This also requires the cable to be properly wired. Unless the software will operate in a highly-controlled environment, this technique is discouraged over using the escape sequence process because of the requirements to make it function properly. Leaving a call connected simply because the cable was not properly wired can be potentially expensive. The escape sequence is reliable in all environments if it is properly utilized.************************************************************************D.7  Modem Re-configurationWhen a call has been completed, a "clean-up" command should be issued to return the modem a more known configuration. For example, if verbose result codes were selected when the modem was reset, and the controller selected numeric result codes, on completing the session, the controller should reset the modem to re-select verbose result codes. In the same way, if the linefeed character were changed to suit the software or environment, the character should be set to its former value. Any other command options that were modified, should be restored to their factory-set values.The minimum the controller should do when through with the modem is issue a Z command option to ensure the modem is restored to its power-up state.************************************************************************D.8  Timing ConsiderationsA modem controller inherently has a sense of time. Usually all that is needed to utilize the timing part of the controller is access to a time reference. For example, the number of milliseconds since power-up or program launch, or a "system tick" value can be used. Under DOS, the INT 1C timer tick produces an interrupt every 55 milliseconds. An ISR can be installed on this interrupt to add 55 to a long integer every time it is called. This will provide a millisecond counter.On the Macinto

⌨️ 快捷键说明

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