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. Hardware & Devices
  4. GSM Modem readiness

GSM Modem readiness

Scheduled Pinned Locked Moved Hardware & Devices
questionc++htmlcomtutorial
2 Posts 2 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.
  • D Offline
    D Offline
    Dr Dan
    wrote on last edited by
    #1

    Hi, I've written a small command line program to send AT modem commands to a USB-connected GSM modem (in fact it's an old Nokia telephone). We use at work it to send SMS reports. Currently the program is still very much experimental, but has been working well. I followed Allen Denver's MSDN article "Serial Communications in Win32" So, in my program I would open a handle to the com port to which the modem is connected. Then, I would write each of the following strings in turn, separated by a 2.5 second pause. 1) "AT+CMGF=1\x0D" to indicate SMS mode. 2) "AT+CMGS=\"+44NNNNNNNNNN\"\x0D" to indicated the destination phone number. 3) "SMS Text\x1A\x0D" to indicate the text to send in the message and terminate the message. Each of these strings is written to the previous file handle within a function I wrote and the return value from this function indicates the success or not of writing the string. I'm not very experienced in serial comms programming. My question is, how do you tell in code that the modem is ready for input? For example, in HyperTerminal you get the "OK" prompt back. Is this just a feature of HyperTerminal? Am I already doing enough by checking that the string was written successfully? What is the "proper" thing to do after writing the string to the com port to check that the modem is ready for more input? I am using C++ to write the program under Windows 2000 and XP. Thanks in advance.

    L 1 Reply Last reply
    0
    • D Dr Dan

      Hi, I've written a small command line program to send AT modem commands to a USB-connected GSM modem (in fact it's an old Nokia telephone). We use at work it to send SMS reports. Currently the program is still very much experimental, but has been working well. I followed Allen Denver's MSDN article "Serial Communications in Win32" So, in my program I would open a handle to the com port to which the modem is connected. Then, I would write each of the following strings in turn, separated by a 2.5 second pause. 1) "AT+CMGF=1\x0D" to indicate SMS mode. 2) "AT+CMGS=\"+44NNNNNNNNNN\"\x0D" to indicated the destination phone number. 3) "SMS Text\x1A\x0D" to indicate the text to send in the message and terminate the message. Each of these strings is written to the previous file handle within a function I wrote and the return value from this function indicates the success or not of writing the string. I'm not very experienced in serial comms programming. My question is, how do you tell in code that the modem is ready for input? For example, in HyperTerminal you get the "OK" prompt back. Is this just a feature of HyperTerminal? Am I already doing enough by checking that the string was written successfully? What is the "proper" thing to do after writing the string to the com port to check that the modem is ready for more input? I am using C++ to write the program under Windows 2000 and XP. Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The 'OK' is part of the modem protocol, it's nothing to do with HyperTerminal. Elaine :rose:

      The tigress is here :-D

      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