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. need help with serial communications

need help with serial communications

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 6 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.
  • L Offline
    L Offline
    Luis Aberto Rodriguez
    wrote on last edited by
    #1

    hi, i'm developing an application for a school project in wich i need to read the data that an open port is about to send to another. is there any way that i can do that? i have search in everywhere and it seems to be no answer for that. can anyone help me? thanks

    J C L S 4 Replies Last reply
    0
    • L Luis Aberto Rodriguez

      hi, i'm developing an application for a school project in wich i need to read the data that an open port is about to send to another. is there any way that i can do that? i have search in everywhere and it seems to be no answer for that. can anyone help me? thanks

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      A serial port can be opened only by one application/thread at time. So there is no chance to do this in a simple way. You may use some hardware that splits the serial lines and mirrors it to another port where you get a copy of the data that has been send. You may create a special send thread that copies the data to a buffer before sending and flushes the buffer after they has been sent. You can then query the unsend data from this thread.

      1 Reply Last reply
      0
      • L Luis Aberto Rodriguez

        hi, i'm developing an application for a school project in wich i need to read the data that an open port is about to send to another. is there any way that i can do that? i have search in everywhere and it seems to be no answer for that. can anyone help me? thanks

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        I suppose you should hook the WriteFile function. Not an easy task, anyway.

        Veni, vidi, vici.

        1 Reply Last reply
        0
        • L Luis Aberto Rodriguez

          hi, i'm developing an application for a school project in wich i need to read the data that an open port is about to send to another. is there any way that i can do that? i have search in everywhere and it seems to be no answer for that. can anyone help me? thanks

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

          Or you can create an upperfilter driver for serial.sys and pump the data back up to your app. Of course this is extremely difficult for most people to do but should you feel up to a mammoth challenge, it is an interesting way to do it. The other way you can do it is to create a dll that manages serial.sys, ie, implements all the Win32 serial functionality and get the other app to talk to your dll instead of the stock system one. But this has its own problems in terms of replacing the system dll with yours.

          1 Reply Last reply
          0
          • L Luis Aberto Rodriguez

            hi, i'm developing an application for a school project in wich i need to read the data that an open port is about to send to another. is there any way that i can do that? i have search in everywhere and it seems to be no answer for that. can anyone help me? thanks

            S Offline
            S Offline
            Sunil P V
            wrote on last edited by
            #5

            Check this link CSerialPort v1.03 - Serial Port Wrapper[^] I am sure this will help you.

            Sunil

            R 1 Reply Last reply
            0
            • S Sunil P V

              Check this link CSerialPort v1.03 - Serial Port Wrapper[^] I am sure this will help you.

              Sunil

              R Offline
              R Offline
              Rolf Kristensen
              wrote on last edited by
              #6

              The latest version can be found here

              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