Thread: What are the Basics of packet programming?

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Arrow What are the Basics of packet programming?

    I am assign to program to send a packet header to a device through a serial port program...

    I am not sure how to program a packet header like, do i convert the commands to binary or hexa...?How am i going to encapsulate the packets..?

    Thanks
    mind your own mind...

    PsychoMantis,

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Here is an analogous question: There is guy in the corner of the bar, I wanna talk to him so should I speak in japanese or russian?

    You need to know what the device you are talking to (i'm assuming there is actually a device and you aren't talking to a unused port) wants. If it needs a certain header than give it what it wants. That is where protocols like TWAIN and winspool come into play. As for the second part of the question (the part I patronized) the computer speaks in binary. It would be a lot of help if you tell me exactly what your game plan is here.

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Question

    Ok for sending a packet to whatever source, how i keep the data inside the packet.
    the header is something like this

    <SOH> |<ETX> | <FF> | <NUL>

    <SOH>= start of header
    <ETX>= end of text
    <FF>= form feed
    <NUL>= null

    Thanks
    mind your own mind...

    PsychoMantis,

  4. #4
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    does this even belong in c++ programming?
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Red face

    Erm...
    THis is the packet to send to the destination.
    the layout of the packet.
    I need to use c to send it.
    mind your own mind...

    PsychoMantis,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet processing in Socket programming, please help
    By pumpkin in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-28-2009, 01:33 AM
  2. Replies: 4
    Last Post: 05-05-2009, 05:35 AM
  3. How to make a Packet sniffer/filter?
    By shown in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2009, 09:51 PM
  4. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  5. Raw Packet (sorry tripple weird Post)
    By Coder87C in forum Networking/Device Communication
    Replies: 6
    Last Post: 03-04-2006, 11:34 AM