Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error Pin
With_problem20-Jul-06 18:57
With_problem20-Jul-06 18:57 
GeneralRe: error Pin
anu_8820-Jul-06 19:19
anu_8820-Jul-06 19:19 
AnswerRe: error Pin
Michael Dunn20-Jul-06 19:12
sitebuilderMichael Dunn20-Jul-06 19:12 
GeneralRe: error Pin
With_problem20-Jul-06 19:19
With_problem20-Jul-06 19:19 
AnswerRe: error Pin
sheetal_0620-Jul-06 21:15
sheetal_0620-Jul-06 21:15 
QuestionHow to get USB device address? Pin
linshi20-Jul-06 17:01
linshi20-Jul-06 17:01 
QuestionSystem-Wide WriteProcessMemory Hook Pin
capricious_00120-Jul-06 16:56
capricious_00120-Jul-06 16:56 
Questionchecksum Pin
thathvamsi20-Jul-06 16:18
thathvamsi20-Jul-06 16:18 
hey all,
I do a checksum logic on both the serial device and the Pc end to see if the correct packet is received.

I do :
<br />
	for (i = 0 ; i < (nMaxLenPkt2Tx - 1); i++)<br />
					  {	cChkSum_2pc ^= txbuffer[i];}<br />
<br />
  						txbuffer[i] = cChkSum_2pc;

and then send the packet from the serial device to PC.


and on Pc's end, I do this after receiving the packet before copying it to a local buffer.
char cChkSum = 0;<br />
		<code>for (i = 0 ; i < (PKTINFO_LEN_MPU_2PC - 1); i++)<br />
			<br />
				cChkSum ^= m_cBufPktInfo_mpu_2pc[i];

and compare this checksum count with teh received checksu count in the packet to determine if it is a correct packet or not. ie.,
if (cChkSum != m_cBufPktInfo_mpu_2pc[PKTINFO_LEN_MPU_2PC - 1])<br />
			{<br />
				TRACE("Received a bad packet!\n");<br />
}<br />


But I get badpacket everytime . Waht could be wrong? the datatypes and the length of the packet sent and received are the same. I have checked that.

Any ideas/help?
Thanks in advance.
AnswerRe: checksum [modified] Pin
anu_8820-Jul-06 18:33
anu_8820-Jul-06 18:33 
QuestionBig Int Class Pin
JrunkDunc20-Jul-06 16:02
JrunkDunc20-Jul-06 16:02 
AnswerRe: Big Int Class Pin
toxcct20-Jul-06 23:14
toxcct20-Jul-06 23:14 
AnswerRe: Big Int Class Pin
JrunkDunc21-Jul-06 12:49
JrunkDunc21-Jul-06 12:49 
Questionhow to create instance??? [modified] Pin
With_problem20-Jul-06 16:01
With_problem20-Jul-06 16:01 
AnswerRe: how to create instance??? Pin
Christian Graus20-Jul-06 16:43
protectorChristian Graus20-Jul-06 16:43 
AnswerRe: how to create instance??? Pin
ThatsAlok21-Jul-06 0:06
ThatsAlok21-Jul-06 0:06 
QuestionReadProcessMemory and dynamic memory allocation Pin
are_all_nicks_taken_or_what20-Jul-06 12:40
are_all_nicks_taken_or_what20-Jul-06 12:40 
AnswerRe: ReadProcessMemory and dynamic memory allocation Pin
Hamid_RT27-Jul-06 7:56
Hamid_RT27-Jul-06 7:56 
QuestionHow to retrieve USB flash drive mount point Pin
mmhu20-Jul-06 11:51
mmhu20-Jul-06 11:51 
QuestionVectors Pin
BlitzPackage20-Jul-06 11:01
BlitzPackage20-Jul-06 11:01 
AnswerRe: Vectors Pin
Chris Losinger20-Jul-06 11:10
professionalChris Losinger20-Jul-06 11:10 
GeneralRe: Vectors Pin
BlitzPackage20-Jul-06 11:36
BlitzPackage20-Jul-06 11:36 
GeneralRe: Vectors Pin
David Crow20-Jul-06 11:42
David Crow20-Jul-06 11:42 
GeneralRe: Vectors Pin
Chris Losinger20-Jul-06 11:48
professionalChris Losinger20-Jul-06 11:48 
GeneralRe: Vectors Pin
BlitzPackage20-Jul-06 12:00
BlitzPackage20-Jul-06 12:00 
GeneralRe: Vectors Pin
Chris Losinger20-Jul-06 12:41
professionalChris Losinger20-Jul-06 12:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.