Click here to Skip to main content
15,904,822 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: vc++6.0 Pin
Anilkumar K V20-Jul-06 18:34
Anilkumar K V20-Jul-06 18:34 
GeneralRe: vc++6.0 Pin
ThatsAlok20-Jul-06 18:45
ThatsAlok20-Jul-06 18:45 
QuestionFetching the text from MS-DOS window Pin
ErixChang20-Jul-06 17:24
ErixChang20-Jul-06 17:24 
AnswerRe: Fetching the text from MS-DOS window Pin
Naveen20-Jul-06 17:30
Naveen20-Jul-06 17:30 
AnswerRe: Fetching the text from MS-DOS window [modified] Pin
_AnsHUMAN_ 20-Jul-06 17:33
_AnsHUMAN_ 20-Jul-06 17:33 
GeneralRe: Fetching the text from MS-DOS window Pin
Naveen20-Jul-06 17:42
Naveen20-Jul-06 17:42 
GeneralRe: Fetching the text from MS-DOS window Pin
_AnsHUMAN_ 20-Jul-06 17:54
_AnsHUMAN_ 20-Jul-06 17:54 
QuestionRe: Fetching the text from MS-DOS window Pin
ErixChang24-Jul-06 21:33
ErixChang24-Jul-06 21:33 
Questionerror [modified] Pin
With_problem20-Jul-06 17:10
With_problem20-Jul-06 17:10 
AnswerRe: error [modified] Pin
Naveen20-Jul-06 17:19
Naveen20-Jul-06 17:19 
GeneralRe: error Pin
With_problem20-Jul-06 17:51
With_problem20-Jul-06 17:51 
GeneralRe: error Pin
Naveen20-Jul-06 17:56
Naveen20-Jul-06 17:56 
GeneralRe: error Pin
With_problem20-Jul-06 18:07
With_problem20-Jul-06 18:07 
GeneralRe: error Pin
anu_8820-Jul-06 18:25
anu_8820-Jul-06 18:25 
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 

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.