How can I achieve TCP data transmission over WiFi Direct?

WiFi Direct is L2 Level feature which takes care of WiFi association between peer-to-peer devices. L4 level data transmission will be the same as that of legacy WiFi modes using AT+NSTCP/AT+NCTCP. The following example is for referencfe only in which TCP client/server is demonstratred once after WiFi Direct association is complete. Using two GS1500 boards, one will be TCP server and the other GS1500 board will be the TCP client.


 

Example:

First GS1500 Board


 

Serial2WiFi APP

 

at+ver=?

S2W APP VERSION=3.4.1.0

S2W GEPS VERSION=3.4.1

S2W WLAN VERSION=3.4.1

OK

 

at+ver=??

S2W APP VERSION=3.4.1.0

S2W GEPS VERSION=3.4.1

S2W WLAN VERSION=3.4.1

S2W BIN TYPE=WFD APP

S2W RELEASE TYPE=GA

BUILD TIME=16:06:56

BUILD DATE=Jul  4 2012

WLAN EXT VERSION=7

OK

at+wrxactive=1

OK

at+antenna=2

OK

at+p2psetdev=15,81,11,11,2388,US

OK

at+p2psetwps=GAINSPAN11-P2P,0006,0001,11223344556677881122334455667788

OK

at+nset=192.168.20.20,255.255.255.0,192.168.20.20

OK

at+dhcpsrvr=1

OK

at+wm=3

OK

at+p2pgostart=11,6.1.3,1

p2p-go-started DIRECT-sX6.1.3,11,02:1d:c9:90:6a:41,1gcM6OVY,05981977

OK

at+apclientinfo=?

No.Of Stations Connected=0

OK

 

p2p-prov-disc-req pbc 02:1d:c9:90:6a:72,02:1d:c9:90:6a:72,0006,0050,f204,0001,GAINSPAN2-P2P,0080,23,00

 

at+apclientinfo=?

No.Of Stations Connected=0

OK

 

at+p2pprovok   ß----------- Once  at+p2pjoin=02:1d:c9:90:6a:41,0 request comes from second GS1500 board, Then run this command.

OK

 

at+apclientinfo=?

No.Of Stations Connected=1

No     MacAddr                   IP

1      02:1d:c9:90:6a:72         ****

OK

 

at+nstcp=1234

CONNECT 0

OK

 

at+cid=?

CID     TYPE    MODE    LOCAL PORT      REMOTE PORT     REMOTE IP

0       TCP     SERVER  1234               0              0.  0.  0.  0

OK

 

CONNECT 0 1 192.168.20.21 61816

1gainspan testing wifi direct

at+cid=?

CID     TYPE    MODE    LOCAL PORT      REMOTE PORT     REMOTE IP

0         TCP     SERVER    1234                            0                0.  0.  0.  0

1         TCP     CLIENT    1234                     61816                192.168. 20. 21

OK


 

Second GS1500 Board

 

Serial2WiFi APP

 

at+ver=??

S2W APP VERSION=3.4.1.0

S2W GEPS VERSION=3.4.1

S2W WLAN VERSION=3.4.1

S2W BIN TYPE=WFD APP

S2W RELEASE TYPE=GA

BUILD TIME=16:06:56

BUILD DATE=Jul  4 2012

WLAN EXT VERSION=7

OK

at+wrxactive=1

OK

at+p2psetdev=10,81,11,11,2388,US

OK

at+p2psetwps=GAINSPAN2-P2P,0006,0001,11223344556677881122334455667733

OK

at+wm=3

OK

at+p2pfind=180,0

OK

 

p2p-dev-found 02:1d:c9:90:6a:41,02:1d:c9:90:6a:41,0006,0050,f204,0001,GAINSPAN11-P2P,11,2388,33,4b

at+p2ppd=02:1d:c9:90:6a:41,0

p2p-prov-disc-resp pbc

OK

 

at+p2pjoin=02:1d:c9:90:6a:41,0

p2p-join-success-client DIRECT-sX6.1.3,11,02:1d:c9:90:6a:41,44848d027608ec2058cf8a6e76c6d2a660f9f82ee5358e7a254be2cda55446ff

OK

at+ndhcp=1

IP              SubNet         Gateway

192.168.20.21:255.255.255.0:192.168.20.20

OK

 

at+nctcp=192.168.20.20,1234

CONNECT 0

OK

 

0gainspan GS1500 wifi direct server responding

 

Powered by Zendesk