|
|
View previous topic :: View next topic |
Author |
Message |
dpechman
Joined: 04 Dec 2007 Posts: 43
|
How to get packet identification and sequence? |
Posted: Sat Mar 24, 2012 2:42 pm |
|
|
I have tried to show on display the packet id and sequence but it always show the same number 99 and 97.
Am I doing right?
Code: |
if ( dataCount <= (MAX_ICMP_DATA_LEN+8) )
{
if ( ICMPGet(&type.ICMPCode,
data,
(BYTE*)&dataCount,
&ICMPId,
&ICMPSeq) )
{
if ( type.ICMPCode == ICMP_ECHO_REQUEST )
{
debug_stack("\r\nICMP PROCESSED");
lbContinue = TRUE;
smStack = SM_STACK_ICMP_REPLY;
}else{ //outros tipo de ICMP
Lcd_Gotoxy(1,1);
printf(Lcd_Caracter, "Seq=%u Id=%u ", &ICMPSeq, &ICMPId);
Lcd_Gotoxy(2,1);
printf(Lcd_Caracter, "RX PING=%2u ", TOTALPACOTES++);
}
}
}
|
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Mar 24, 2012 2:50 pm |
|
|
You're printing addresses rather than values. Try
Code: | printf(Lcd_Caracter, "Seq=%u Id=%u ", ICMPSeq, ICMPId); |
|
|
|
dpechman
Joined: 04 Dec 2007 Posts: 43
|
|
Posted: Sat Mar 24, 2012 3:11 pm |
|
|
YEAH, thanks!
Is working now, just change to format because vars are long int
Code: |
printf(Lcd_Caracter, "Seq=%Lu Id=%Lu ", ICMPSeq, ICMPId);
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|