CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to get packet identification and sequence?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dpechman



Joined: 04 Dec 2007
Posts: 43

View user's profile Send private message Visit poster's website

How to get packet identification and sequence?
PostPosted: Sat Mar 24, 2012 2:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Mar 24, 2012 2:50 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sat Mar 24, 2012 3:11 pm     Reply with quote

YEAH, thanks!

Is working now, just change to format because vars are long int

Code:

printf(Lcd_Caracter, "Seq=%Lu Id=%Lu      ", ICMPSeq, ICMPId);
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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