Problem with Net_Ethernet_28j60_getByte() to get data

General discussion on Libstock website & codes posted on this website.
Post Reply
Author
Message
Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Problem with Net_Ethernet_28j60_getByte() to get data

#1 Post by Prof.Wagner » 06 Mar 2013 16:47

HI All,

I am having problem to get correct data from "Net_Ethernet_28j60_getByte() " command.

Some times when I send data from server to my device (client) like =>"1234567890" or any another data, I recieve these data correctly but sometimes plus some other data like => "1234567890aabbcabbac.... What is wrong with my code below?

Maybe I am not reading the data correctly. Maybe I am forgeting some thing to do in my routine.

Could you help me? below the routine that I am using to read data from TCP port (my device is client)

I am using mikrobasic with pic 24F and Libstock library. I can send data from my device to the server very well I can do the ping command very well too.

Thank you in advance

prof. Wagner

sub procedure Net_Ethernet_28j60_UserTCP(dim SOCKET as ^SOCKET_28j60_Dsc)
TAIL = 0
WHILE (1)
BYTEIN = Net_Ethernet_28j60_getByte() ' read data from tcp
IF (BYTEIN = "") THEN
buf_rec_data[tail] = "" ' end of string
command_VT100() ' go to routine that will process these datas
break
ELSE
buf_rec_data[tail] = BYTEIN
INC (TAIL)
END IF
WEND
end sub

Post Reply

Return to “Libstock Discussion”