Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Modem AT commands

Modem AT commands

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    How to send AT command to modem?

    D J C 4 Replies Last reply
    0
    • A Anonymous

      How to send AT command to modem?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      One way is to use outp().

      A 1 Reply Last reply
      0
      • D David Crow

        One way is to use outp().

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        outp()? What's that? Have found no trace in VC Help

        D 1 Reply Last reply
        0
        • A Anonymous

          outp()? What's that? Have found no trace in VC Help

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          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[^]

          1 Reply Last reply
          0
          • A Anonymous

            How to send AT command to modem?

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            :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!

            1 Reply Last reply
            0
            • A Anonymous

              How to send AT command to modem?

              J Offline
              J Offline
              John R Shaw
              wrote on last edited by
              #6

              :(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!

              1 Reply Last reply
              0
              • A Anonymous

                How to send AT command to modem?

                C Offline
                C Offline
                Chintan
                wrote on last edited by
                #7

                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

                A 1 Reply Last reply
                0
                • C Chintan

                  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

                  A Offline
                  A Offline
                  Anonymous
                  wrote on last edited by
                  #8

                  I can send AT commands using WriteFile. But how can I, for example, transmit byte to a remote system when I'm already connected?

                  J C 2 Replies Last reply
                  0
                  • A Anonymous

                    I can send AT commands using WriteFile. But how can I, for example, transmit byte to a remote system when I'm already connected?

                    J Offline
                    J Offline
                    John R Shaw
                    wrote on last edited by
                    #9

                    WriteFile() Trust in the code Luke. Yea right!

                    1 Reply Last reply
                    0
                    • A Anonymous

                      I can send AT commands using WriteFile. But how can I, for example, transmit byte to a remote system when I'm already connected?

                      C Offline
                      C Offline
                      Chintan
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups