Using WIP TCP Client Sample

#1

Hi all,

Whoever can help me I would really appreciate it.

I’m using the WIP TCP Client Sample code because it is similar to what I need to accomplish.

My problem is that I can’t figure out how send data from my external app through the socket connection.

I’m using the UART1 as the input for the data

In the sample code it performs WIP_CEV_WRITE only once. I want to set it to write whenever data come in from the serial (UART1).

Thanks in advance.

Eddie

0 Likes

#2

hi eddie435,
If you want to send data whenever the WCPU receive data on UART1, you can develop your own code base on CTPClient Sample. You should read the WIP_Development_Guide.pdf for more detail. Another way that you can use WipSoft, so you just need develop your appl on PC or micro controller which communicate with WCPU.
ttt

0 Likes

#3

Thanks trthaithong,

I am using the TCPClient sample which sends data only once. What I can figure out is how to trigger the WIP_CEV_WRITE event in my event handler so that it will send the data as it is received from the UART1.

0 Likes

#4

Hi eddie435,
You can send data to socket whenever the socket is established successfull with adl_write ADL. For your information that, after you set up a socket successful, you will receive a WIP_CEP_WRITE event in the event Handler function, you can trigger this event to begin enable sending data over this socket.
ttt

0 Likes

#5

hi thraithong,

I’m facing not actually the same problem with eddy435. i’ve successfully triggered the WIP_CEV_WRITE event.
and i’ve set up the callback handler to switch between event. and it worked on the beginning, the WIP_CEV_WRITE managed to trigered the wip_write function. and the return value was captured in the Write variable. and i convert the Write variable from the integere u32. into ascii using the wm_itoa function. and i sent the result to the hyper terminal using adl_atSendResponse().
and when i ran the program, the hyper terminal give a response like this

inside the WIP_CEV_WRITE
19 ==> this is the returned value from the wip_write().

what i want to ask is, does this result means that i am successfully write and send the data to the destination? because from the guide i read that the WIP_CEV_WRITE is just an event which will be generated if the data is READY to be sent. but i couldn’t find other function to send the data that was ready.

and about the Ping Socket. if i receive the response is like this :
[WIP] new PING 0x180c6454
[WIPEV] WIP_CEV_OPEN @ PING 0x180c6454

this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c6454 (seq=0, time=0ms, timeout=true)

this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c6454 (seq=1, time=0ms, timeout=true)

this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c6454 (seq=2, time=1000ms, timeout=false)

this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c6454 (seq=3, time=500ms, timeout=false)

this is inside the PingHandler
[WIPEV] WIP_CEV_PEER_CLOSE @ PING 0x180c6454

does this mean that i’m succesfully pinging the destination?? what is the difference between timeout = true and timeout = false?

thank you so much for your time and explanation.

regards,
edy2

0 Likes

#6

Hi edy2,

-> You are successfully in writing data. Whenever the wip_write function finish, it will issue a WIP_CEV_WRITE event.

-> It is seem that you are not successfully in pinging the destination.
ttt

0 Likes

#7

But in my TMT the trace was like this when i use the ping command;
Trace NET 16 IP-OUT 10.33.81.91 > 64.233.189.99 pr:1 len:92 id:11 off:0
Trace NET 16 IP-OUT 10.33.81.91 > 64.233.189.99 pr:1 len:92 id:12 off:0
Trace NET 16 IP-INP 10.33.81.91 < 64.233.189.99 pr:1 len:84 id:11 off:0
Trace NET 17 ICMP-INP 10.33.81.91 < 64.233.189.99 Echo Reply (0)
Trace NET 22 RWIP-INP Socket found
Trace NET 16 IP-OUT 10.33.81.91 > 64.233.189.99 pr:1 len:92 id:13 off:0
Trace NET 16 IP-INP 10.33.81.91 < 64.233.189.99 pr:1 len:84 id:12 off:0
Trace NET 17 ICMP-INP 10.33.81.91 < 64.233.189.99 Echo Reply (0)
Trace NET 22 RWIP-INP Socket found

what is the meaning of the word socket found ?
and again i really need to know what is the difference between time out = true and false.

i’m sorry for the disturbance, it’s just that i didn’t know how to fix this GPRS problem if i couldn’t even fix the ping problem first.
because i’m planning to make a standalone server and client in my application. therefore the ping function is very essentials to detect whether the other modem is connected to the network or not.

but thank you very much for the quick reply… i appreciated that.

Regards,
Edy2

0 Likes