Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 10th, 2007, 9:04 AM   #1
amitpansuria
Newbie
 
Join Date: Aug 2007
Posts: 13
Rep Power: 0 amitpansuria is on a distinguished road
how i prepare c++ code for implementing my own protocol

helo my protocol format is given below

{ destno,mode,no.of packet,pktsize,,pktno,textsize,CRC}
description:- { is starting flag
destno - 4bytes
mode - 1 byte
no.of pkt - 4byes
pktsize - 6 bytes
pktno 3 bytes
text size 6 bytes
CRC is 2 bytes
i want to write c++ code(or c code) to prepare this packet and after this
i want to transfer this packet over serial port.
after that how i write a code to receive this packet from serial port and how i extract this packet after receiving the packet.
Regards,
Amit
Reply With Quote
amitpansuria is offline   Reply With Quote
Old Aug 10th, 2007, 11:31 AM   #2
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
First you'd write code which would take destno, mode, no.of packet, pktsize, pktno, textsize & CRC as variables and package them as you've described. After that you could send that packet across the serial port to a waiting client/server which would undo the packaging giving back the original variables destno, mode, no.of packet, pktsize, pktno, textsize & CRC.

As for the requested quote
Quote:
Originally Posted by me
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote
Old Aug 11th, 2007, 1:27 AM   #3
amitpansuria
Newbie
 
Join Date: Aug 2007
Posts: 13
Rep Power: 0 amitpansuria is on a distinguished road
can u help me with code

Quote:
Originally Posted by Eoin View Post
First you'd write code which would take destno, mode, no.of packet, pktsize, pktno, textsize & CRC as variables and package them as you've described. After that you could send that packet across the serial port to a waiting client/server which would undo the packaging giving back the original variables destno, mode, no.of packet, pktsize, pktno, textsize & CRC.

As for the requested quote
Thx for replying me.
but i m new in this stuff.
can u explain me with code and
u told that after preparing the packet i have to send to client /server
but in serial communication is it possible to implement client -server concept.
anyway first help in writing code for this packet preparation
Thx n Regards,
Amit
amitpansuria is offline   Reply With Quote
Old Aug 11th, 2007, 4:10 AM   #4
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
well dont expect to be spoon fed. If you can provide some base code so far may be you should look around the forum some. I do recall seeing some post about writing up your own client/server data sending apps, but im not sure what protocal why were in.

Also as may say use your google Fu.
try looking herer for serial info....might help.....
http://en.wikipedia.org/wiki/Serial_communication

sounds like a nice project.
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Old Aug 11th, 2007, 9:45 AM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
Thx for replying me.
but i m new in this stuff.
can u explain me with code and
u told that after preparing the packet i have to send to client /server
but in serial communication is it possible to implement client -server concept.
anyway first help in writing code for this packet preparation
Thx n Regards,
Amit
Computer languages require precise syntax. You will need to get into that habit. Addressing us with AOL syntax a la a 10-year old (such as "but i m new") merely tells us that you are too lazy and/or stupid to deserve serious help. Get real. Grow up. Cut your fingernails. No one is using a 300 baud modem these days. "Am" is spelled "A-M", not "M". Capitalization requires the ability to coordinate the pinky in such a way that the shift key is pressed while pressing another key. Can you handle that? If not, you don't need to be trying to learn a programming language.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EXECryptor software protection Jean5 C++ 35 Oct 10th, 2006 7:10 PM
Little help whoawhoayoyo Assembly 8 Apr 18th, 2006 7:10 PM
How to post a question nnxion C++ 10 Jun 3rd, 2005 11:53 AM
How to post a question nnxion C++ 0 Jun 3rd, 2005 8:55 AM
How to post a question nnxion C 0 Jun 3rd, 2005 8:55 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:47 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC