WiFi Direct
1) WiFi Direct 초기화 동작(1회성)
ifconfig wlan0 down;
ifconfig wlan0 up;
ifconfig wlan0 192.168.3.1;
route add default gw 192.168.3.1;
/root/udhcpd/udhcpd /root/udhcpd/udhcpd.conf;
2) WiFi Direct 활성화
killall wpa_supplicant;
killall hostapd;
iwpriv wlan0 p2p_set enable=0;
iwpriv wlan0 p2p_set enable=3;
iwpriv wlan0 p2p_set intent=15;
iwpriv wlan0 p2p_set op_ch=1;
iwpriv wlan0 p2p_set ssid=DIRECT-RT;
iwpriv wlan0 p2p_set setDN=RTL8192CU;
iwpriv wlan0 p2p_set got_wpsinfo=2;
hostapd -B /usr/local/bin/p2p_hostapd.conf > /system/temp.txt;
3) WiFi Direct 상태 확인
iwpriv wlan0 p2p_get status
Status :
P2P_STATE_NONE = 0, // P2P disable
P2P_STATE_IDLE = 1, // P2P had enabled and do nothing
P2P_STATE_LISTEN = 2, // In pure listen state
P2P_STATE_SCAN = 3, // In scan phase
P2P_STATE_FIND_PHASE_LISTEN = 4, // In the listen state of find phase
P2P_STATE_FIND_PHASE_SEARCH = 5, // In the search state of find phase
P2P_STATE_TX_PROVISION_DIS_REQ = 6, // In P2P provisioning discovery
P2P_STATE_RX_PROVISION_DIS_RSP = 7,
P2P_STATE_RX_PROVISION_DIS_REQ = 8,
P2P_STATE_GONEGO_ING = 9, // Doing the group owner negoitation handshake
P2P_STATE_GONEGO_OK = 10, // finish the group negoitation handshake with success
P2P_STATE_GONEGO_FAIL = 11, // finish the group negoitation handshake with failure
P2P_STATE_RECV_INVITE_REQ = 12, // receiving the P2P Inviation request
P2P_STATE_PROVISIONING_ING = 13, // Doing the P2P WPS
P2P_STATE_PROVISIONING_DONE = 14, // Finish the P2P WPS
4) 연결 동작
4-1) GO
hostapd_cli wps_pbc any
4-2) Client
wpa_cli wps_pbc [MacAddress]
5) 연결된 WiFi Direct 확인
hostapd_cli all_sta
6) WiFi Direct 클라이언트 연결 해제
hostapd_cli deauthenticate [MAC Addredd]
'Development > WiFi Direct(P2P)' 카테고리의 다른 글
WiFi Direct Linux Menuconfig (0) | 2015.10.27 |
---|---|
wpa_cli 명령어 (0) | 2014.04.28 |
WiFi Direct 구현 (0) | 2014.04.28 |
Android Smart Phone WiFi Direct 파일 전송 테스트 (0) | 2014.04.28 |
Android Smart Phone WiFi Direct 연결 테스트 (0) | 2014.04.28 |