![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What does this code mean... | azazalis | Shell Programming and Scripting | 2 | 08-13-2006 05:02 AM |
| SSH key code versus server key code | Texan | Security | 1 | 04-12-2006 11:57 AM |
| 32-bit code with gcc | amol.chavan | High Level Programming | 1 | 06-22-2004 10:58 AM |
| Return code from PL/SQL Code | Shaz | UNIX for Advanced & Expert Users | 7 | 06-03-2003 10:56 AM |
| code help | bb00y | High Level Programming | 3 | 10-12-2002 08:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how i prepare a c++ code(c code) for implementing my own protocol format
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 |
|
||||
|
You need six bytes for a packet size? Wow.
Do you have code to generate and check CRCs? sending side Code:
len=call_generate_crc(buf,len); write(fd,buf,len); Code:
while (1)
{
if (read(fd,buf,1) !=1) exit(1);
if (buf[0]==start_of_packet) break;
}
..... /*read rest of packet */
check_crc(buf,len);
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|