Modem AT commands
-
One way is to use outp().
-
One way is to use outp().
-
int _outp( unsigned short port, int databyte ); unsigned short _outpw( unsigned short port, unsigned short dataword ); unsigned long _outpd( unsigned short port, unsigned long dataword );
The _outp(), _outpw(), and _outpd() functions write a byte, a word, and a double word, respectively, to the specified output port. The port argument can be any unsigned integer in the range 0 – 65,535; databyte can be any integer in the range 0 – 255; and dataword can be any value in the range of an integer, an unsigned short integer, and an unsigned long integer, respectively. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__outp.2c_._outpw.2c_._outpd.asp[^] -
:mad:Sorry my hands are shaking after reading the replies you have already recieved. Read up on TAPI (Telephony API) in the MSDN Library (the best way to hanle modems). If you are writing your onwn code to access the modem (Not recommend - but I had to do it for Win31 [and port to Win32 still uses it]) via a comport then read up on how to open a comport via CreateFile() in the MSDN Libaray. Once you have an open open comport handle then you can use WriteFile() to send the AT commands (text commands) with WriteFile(), just like you would if you were writing to a file. As for _outp() and _outw() those are used to access hardware ports (very low level), not for accessing a modem. You can not even use these function to access hardware for you program under WinNT/Win200/WinXP, unless you are using a driver like UserPort.sys (freeware-on the net). Normaly only a system kernal-mode driver can access hardware ports under those systems. Trust in the code Luke. Yea right!
-
:(Sorry I was so upset that a replied to the wrong person. Look thru the list of replies to your post for my answer. If you need more infomation let me know. Trust in the code Luke. Yea right!
-
One easy way to sent commands to modem: Open a port using CreateFile() api. Then you will able to read or write on that handle using ReadFile() & WriteFile() apis just like as you read and write from file. Thats all !!!!!!!!!!!! C.R.Naik
-
I can send AT commands using WriteFile. But how can I, for example, transmit byte to a remote system when I'm already connected?
WriteFile() Trust in the code Luke. Yea right!
-
I can send AT commands using WriteFile. But how can I, for example, transmit byte to a remote system when I'm already connected?
Modem works in two modes. One is command mode and another one is Online(data) mode. While modem is in command mode it replies apropriatly to your commands. While it is in online mode whatever you are sending to it through port, it will forward it to remote modem. So to transmit byte to remote system you have to bring modem in Online mode first. Chintan C.R.Naik