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

TCPIP example returns unexpected data?!

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

TCPIP example returns unexpected data?!
PostPosted: Fri Mar 15, 2013 3:27 am     Reply with quote

Hi, everyone! I`m using TCPIP stack v30_nov_06! I`m trying to rework ex13b.c. So witout any changes this example returns something like this:

Code:

BUTTON C=0 gafadfaf
gfadgas
fgdafdadffdsfhjhgjhert
rtrewtytrhdfs
trsdtgfhfsda
.......
bla bla bla

I`m connecting to the PCB through TELNET
Code:
telnet 192.168.0.3 1000


I tried to rework the TCPConnectedTask():
Code:

int8 TCPConnectedTask(TCP_SOCKET socket, int8 which)
{
   char c;
   static int8 counter[NUM_LISTEN_SOCKETS];
   static int8 button1_held[NUM_LISTEN_SOCKETS];
   char str[13]="Hello server";
   int8 i=0;

   if (TCPIsGetReady(socket)) {
      while (TCPGet(socket, &c)) {
         lcd_str[which][i++]=c;
         if (i>=20) {i=19;}
         lcd_str[which][i]=0;
      }
   }
   if(TCPIsPutReady(socket))
   {
   TCPPutArray(socket,str,strlen(str));
      TCPFlush(socket);
   }
   return(TRUE);
}

to be more simple. It just returns Hello server and closes the connection. But again after Hello server I recieve about 10 extra rows with extra meaningless data.
Can you tell me am I doing anything wrong??
How to remove this extra data?
Thanks!
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