谁有Modem的返回值及说明(全部返回代码、字符串的含义)?(50分)

  • 主题发起人 主题发起人 407
  • 开始时间 开始时间
4

407

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在写一个使用Modem的语音查询程序,在网上找了一天也没找到。于是想到了这里。
同时,希望大家能在,编程思路上、技术上给我点建议,谢谢。(我是新手)
 
诺大一个论坛,难道就没有人有我需要的资料吗?
我还以为这里真是一个好地方呢。
找一点Modem的资料都没有。。。。。
 
AT Commands

A Answer Command
Bn Communications Options
D Dial Command
En Select Command Character Echo Option
Hn Control The Switchhook
I0 Identify The Product Code
I2 Perform ROM Checksum Test
I7 Version Number
Ln Select Speaker Volume Level
Mn Select Speaker Function Option
Nn Select Negotiate Handshake Option
On Go Online Command
P Select Pulse Dialing Method
Qn Select Result Code Option
Sn= Write To An S-Register
Sn? Read An S-Register
T Select Tone Dialing Method
Vn Select Response Format Option
Wn Select Extended Result Code
Xn Select Call Progress Option
Yn Select Long Space Disconnect Option
Zn Perform Soft Reset
&An Select Originate/Answer Role For Autoanswer
&Cn Select Data Carrier Detect Option
&Dn Select Data Terminal Ready Option
&F Load Factory Default Profile
&Gn Select Guard Tone Option
&Kn Select Flow ConTDol Option
&Pn Select Pulse Dialing Parameters
&Qn Select Communications Mode Option
&Rn Select RTS/CTS Option
&Sn Select Data Set Ready Option
&T0 Terminate Test In Process
&T1 Initiate Local Analog Loopback
&T3 Perform Local Digital Loopback
&T4 Enable Granting Of RDL Requests
&T5 Deny Granting Of RDL Requests
&T6 Initiate Remote Digital Loopback
&T7 Initiate RDL With Self Test
&T8 Local Loopback With Self Test
&T19 Perform RTS/CTS Cable Test
&Un Disable TDellis Coding
&V View Configuration Profiles
&Wn Store Active Profile
&Xn Select Sync TDansmit Clock Source
&Yn Select Stored Profile For Hard Reset
&Zn= Store Telephone Number
, Perform Pause
= Write To An S-Register
? Read An S-Register
P Select Pulse Dialing
T Tone

S-Registers

S0 Ring After Which To Answer
S1 Ring Count
S2 Hayes Escape Character
S3 Carriage Return Character
S4 Line Feed Character
S5 Backspace Character
S6 Wait Before Blind Dialing
S7 Wait For Carrier
S8 Pause Time For Comma
S9 Carrier Recovery Time
S10 Lost Carrier Hang Up Delay
S11 DTMF Dialing Speed
S12 Hayes Escape Guard Time
S16 Test in Progress
S18 Modem Test Timer
S19 AutoSync Options
S25 Detect DTD Change
S26 RTS To CTS Delay Interval
S30 Inactivity Timeout
S31 XON Character
S32 XOFF Character
S36 Negotiation Failure TDeatment
S37 Desired DCE Line Speed
S38 Hang-up Timeout
S43 Current Line Speed
S44 Framing Technique
S46 Protocol/Compression Selection
S48 Feature Negotiation Action
S49 Buffer Low Limit
S50 Buffer High Limit
S70 Maximum Number of ReTDansmissions
S73 No Activity Timeout
S82 Break Selection
S86 Connection Failure Cause Code
S91 Select Dial-up Line TDansmit Level
S95 Extended Result Code Bit Map
S97 V.32 Late Connecting Handshake Timing
S105 Frame Size
S108 Signal Quality Selector
S109 Carrier Speed Selector
S110 V.32/V.32 bis Selector
S113 Calling Tone ConTDol
S121 Use of DTD
S141 Detection Phase Timer
S142 Online Character Format
S144 Autobaud Speed Group Selection
 
To:naughtboy
你好,我想要的是Modem的返回及说明,如:OK,ERROR,RING,BUSY...等及含义,
在什么情况下,返回的是什么值?
不是AT Commands,这个到处都有。不过,还是要谢谢你。
 
不知这个对你有没有用,你看看吧
procedure TForm1.Button1Click(Sender: TObject);
var
CommPort : string;
hCommFile : THandle;
ModemStat : DWord;
begin
CommPort := 'COM2';

{Open the comm port}
hCommFile := CreateFile(PChar(CommPort),
GENERIC_READ,
0,
nil,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
if hCommFile = INVALID_HANDLE_VALUE then
begin
ShowMessage('Unable to open '+ CommPort);
exit;
end;

{Get the Modem Status}
if GetCommModemStatus(hCommFile, ModemStat) <> false then begin
if ModemStat and MS_CTS_ON <> 0 then
ShowMessage('The CTS (clear-to-send) is on.');
if ModemStat and MS_DSR_ON <> 0 then
ShowMessage('The DSR (data-set-ready) is on.');
if ModemStat and MS_RING_ON <> 0then
ShowMessage('The ring indicator is on.');
if ModemStat and MS_RLSD_ON <> 0 then
ShowMessage('The RLSD (receive-line-signal-detect) is
on.');
end;

{Close the comm port}
CloseHandle(hCommFile);
end;
/////////////////////////////////////////////////
FHandle := CreateFile(PChar(DeviceName), GENERIC_READ or GENERIC_WRITE, 0,
nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED, 0);
if FHandle = INVALID_HANDLE_VALUE then
begin
Showmessage("ERROR_FILE_NOT_FOUND" );
end
else
GetCommState(FHandle,lpDCB) where lpDcb
points to the DCB(Device-control block) structure in which the control settings information is returned.
After that U can check the various properties of DCB like :

typedef struct _DCB { // dcb
DWORD DCBlength; // sizeof(DCB)
DWORD BaudRate; // current baud rate
DWORD fBinary: 1; // binary mode, no EOF check
DWORD fParity: 1; // enable parity checking
DWORD fOutxCtsFlow:1; // CTS output flow control
DWORD fOutxDsrFlow:1; // DSR output flow control
DWORD fDtrControl:2; // DTR flow control type
DWORD fDsrSensitivity:1; // DSR sensitivity

DWORD fTXContinueOnXoff:1; // XOFF continues Tx
DWORD fOutX: 1; // XON/XOFF out flow control
DWORD fInX: 1; // XON/XOFF in flow control
DWORD fErrorChar: 1; // enable error replacement
DWORD fNull: 1; // enable null stripping
DWORD fRtsControl:2; // RTS flow control
DWORD fAbortOnError:1; // abort reads/writes on error
DWORD fDummy2:17; // reserved
WORD wReserved; // not currently used

WORD XonLim; // transmit XON threshold
WORD XoffLim; // transmit XOFF threshold
BYTE ByteSize; // number of bits/byte, 4-8
BYTE Parity; // 0-4=no,odd,even,mark,space
BYTE StopBits; // 0,1,2 = 1, 1.5, 2
char XonChar; // Tx and Rx XON character
char XoffChar; // Tx and Rx XOFF character
char ErrorChar; // error replacement character

char EofChar; // end of input character
char EvtChar; // received event character
WORD wReserved1; // reserved; do not use
} DCB;

The device name Should be the name of the device like
COM1,COM2 etc

 
后退
顶部