![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2007
Posts: 13
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 | |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
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:
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Aug 2007
Posts: 13
Rep Power: 0
![]() |
can u help me with code
Quote:
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 |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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 |
|
|
|
|
|
#5 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |