Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I construct a TCP/IP layer over serial port?

lingz_publiclingz_public Member Posts: 2
If I get data messages from COM port, how can I put a TCP/IP layer over it? I totally have no idea about that.
Any suggestions appreciated!

Comments

  • weiccoweicco Member Posts: 950
    : If I get data messages from COM port, how can I put a TCP/IP layer over it? I totally have no idea about that.
    : Any suggestions appreciated!
    :

    What OS?

    In Win NT / 2000 / XP I think you need to write driver that is bound to COM on lower edge and TCPIP on upper edge. I don't know much about 9x.
  • lingz_publiclingz_public Member Posts: 2
    what job should be done on the lower edge? What should be bounded to the COM port? Is that some function like MAC construction and routing as the role of the network card? I have no idea about that. Is the driver does so?
  • weiccoweicco Member Posts: 950
    : what job should be done on the lower edge? What should be bounded to the COM port? Is that some function like MAC construction and routing as the role of the network card? I have no idea about that. Is the driver does so?
    :

    I'm not sure about this since I've never used COM ports before. I've worked more on NDIS Intermediate drivers.

    I think you need virtual miniport driver and get IP for it. Then you need somekind of system thread or something to listen data coming from COM port. When data arrives wrap it to NDIS packet and send it up to TCPIP with NDIS.

    When sending data to COM port NDIS calls your miniport's MiniportSend function. You need to allocate new NDIS packet, copy the NDIS packet to new packet, remove the NDIS header and send the packet to COM port. When you have removed NDIS header packet contains ethernet header and all other possible header (IP, ARP, ICMP, TCP, UDP...).

    I think you need to call SERIAL.SYS to transmit / receive packets to / from COM port but I don't know how. You can ask more information from http://groups.google.com/groups?hl=en&safe=off&group=comp.os.ms-windows.programmer.nt.kernel-mode

    I don't think you need to worry about routing or other stuff because you are bound to TCPIP on upper edge. Just send packets to COM port and if there is somebody listening it will answer and TCPIP handles rest.
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    __ | http://forcoder.org | free video tutorials and ebooks about / MATLAB, Ruby, Visual Basic .NET, C, Perl, Objective-C, Assembly, PHP, JavaScript, Python, PL/SQL, Swift, Delphi, Scratch, Go, Java, C++, R, Visual Basic, C# Prolog, Rust, ML, Scala, SAS, FoxPro, Scheme, Dart, Hack, Clojure, LabVIEW, F#, Awk, Kotlin, Logo, Fortran, VBScript, Ada, Erlang, Crystal, Bash, Julia, Alice, D, Lua, COBOL, Apex, Transact-SQL, Lisp, ABAP / ______________

Sign In or Register to comment.