how to get UDP remote IP and port for UDP mode 2?

doughboy
Posts: 63
Joined: Thu Mar 05, 2015 1:54 am

how to get UDP remote IP and port for UDP mode 2?

Postby doughboy » Fri Mar 20, 2015 4:19 am

If I do
AT+CIPSTART=1,"UDP","192.168.1.25",1000,1001,2

and I receive UDP packet from another remote ip, how do I determine the remote ip and port of the sender?
I understand in mode 2, CIPSEND will send the data to the remote ip where the last incoming packet came from.

Thanks.

doughboy
Posts: 63
Joined: Thu Mar 05, 2015 1:54 am

Re: how to get UDP remote IP and port for UDP mode 2?

Postby doughboy » Fri Mar 20, 2015 9:50 am

I see the remote ip can be found using CIPSTATUS

AT+CIPSTART=1,"UDP","0.0.0.0",0,55055,2
1,CONNECT
OK
AT+CIPSTATUS
STATUS:4
+CIPSTATUS:1,"UDP","0.0.0.0",38792,55055,0
OK
+IPD,1,4:test
OK
AT+CIPSTATUS
STATUS:4
+CIPSTATUS:1,"UDP","192.168.1.16",55056,55055,0
OK
AT+CIPSEND=1,5
OK
> abc

+IPD,1,3:ack
OK
SEND OK

Who is online

Users browsing this forum: No registered users and 188 guests