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. .NET (Core and Framework)
  4. SerialPort

SerialPort

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharp
4 Posts 3 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
    amirreza_nl
    wrote on last edited by
    #1

    Hi, I want to do simple thing but I can't and I'm confused. I want to send a simple at command to my modem. like atdt8889653 SerialPort s = new SerialPort("com3", 2400, Parity.None, 8, StopBits.One); try{ s.Open(); s.Write("atdt8889653"); ... } catch { ... } but it seems it doesn't work because my modem doesn't call; my apps is win form I see this code http://www.dreamincode.net/forums/showtopic35775.htm[^] but it doesn't work. (I can connect to my modem via hyper terminal and type at commands and get correct responces)

    A L 2 Replies Last reply
    0
    • A amirreza_nl

      Hi, I want to do simple thing but I can't and I'm confused. I want to send a simple at command to my modem. like atdt8889653 SerialPort s = new SerialPort("com3", 2400, Parity.None, 8, StopBits.One); try{ s.Open(); s.Write("atdt8889653"); ... } catch { ... } but it seems it doesn't work because my modem doesn't call; my apps is win form I see this code http://www.dreamincode.net/forums/showtopic35775.htm[^] but it doesn't work. (I can connect to my modem via hyper terminal and type at commands and get correct responces)

      A Offline
      A Offline
      Alan N
      wrote on last edited by
      #2

      Hi, Do you need to append a carriage return to your command strings? HyperTerminal would do this when you press the enter key. Alan.

      A 1 Reply Last reply
      0
      • A amirreza_nl

        Hi, I want to do simple thing but I can't and I'm confused. I want to send a simple at command to my modem. like atdt8889653 SerialPort s = new SerialPort("com3", 2400, Parity.None, 8, StopBits.One); try{ s.Open(); s.Write("atdt8889653"); ... } catch { ... } but it seems it doesn't work because my modem doesn't call; my apps is win form I see this code http://www.dreamincode.net/forums/showtopic35775.htm[^] but it doesn't work. (I can connect to my modem via hyper terminal and type at commands and get correct responces)

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, a wild guess: your modem needs hardware handshake, and you did not enable it for COM3. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


        1 Reply Last reply
        0
        • A Alan N

          Hi, Do you need to append a carriage return to your command strings? HyperTerminal would do this when you press the enter key. Alan.

          A Offline
          A Offline
          amirreza_nl
          wrote on last edited by
          #4

          Thanks a lot. Yes I must add carriage return to the end of the string (+"\r").

          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