文章目录
测试命令汇总
# wifi_drv
(wifi_drv)# help
Commands available:
help Show available cmds
exit Exit from current cmd set
history Show history cmds
get_connect get connect status cmd
get_status get status cmd
get_signal get sta connect signal poll cmd
ap_get get ap status cmd
ctrl_thread wifi drv ctrl thread cmd
p2p_listen wifi drv P2P listen cmd
p2p_init wifi drv P2P param init
p2p wifi drv P2P disable or enable
sta_disconnect wifi drv sta disconnect
sta_connect wifi drv sta connect
ap wifi drv ap enable or disable
scan_results wifi drv scan results get
wifi_scan wifi drv scan test
station
- net ifconfig wlan0 up 启动WiFi网卡
- wifi_drv ctrl_thread wlan0 启动事件监控
wifi_scan
wifi_drv wifi_scan <ifname>
#wifi_drv wifi_scan wlan0
argc : 2
atbmwifi_start_wifimode:other_alive_if(0),all_alive_if(0)
[atbm_wx_set_scan][910] wlan0 switch to sta mode
atbm_wifi_scan_network_vif(0)
[atbmwifi_scan_process][335] in_progress = 0
[atbmwifi_scan_process][344] scan_ret.info = 0x81fb6000
[atbm_scan_work] atbmwifi_scan_start
Wifi start scan req band 0 type 0 ch 13
wait scan done++
scan_no_connect: 1
SSID: Germany
channel 1
ht[0] wpa[1] rsn[0] enc[1] security[3]
SSID: HQGuest
channel 1
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: qt_Xiaomi_93E7
channel 1
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: TP-LINK_F502
channel 1
ht[1] wpa[0] rsn[0] enc[0] security[0]
SSID: TP-LINK_WPA3
channel 1
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID:
channel 1
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: 2.4G_OK_Guest
channel 3
ht[1] wpa[0] rsn[0] enc[0] security[0]
SSID: 中文测试
channel 3
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: TP-LINK_A422
channel 6
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: ChinaNet-adhd
channel 6
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: iserver_haiqi
channel 6
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: KunPeng_Meeting
channel 6
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HiChip访客-KP
channel 6
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: Trainner
channel 7
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: hcck
channel 8
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: OrayBox-2.4G-68AC
channel 8
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HICHIP_TEST111
channel 11
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: hichip
channel 11
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: Hichiptech
channel 11
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: Redmi_ttoonnyy
channel 11
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: XuanYuan_Meeting
channel 11
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: TP-LINK_0AB516_qt_ed
channel 11
ht[1] wpa[1] rsn[1] enc[1] security[5]
Wifi start scan req band 1 type 2 ch 14
SSID: sw6-5G
channel 36
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: XuanWu_Guest_5G
channel 36
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: 中文测试_5G
channel 36
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: 中文测试_5G_Wi-Fi5
channel 36
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: TP-LINK_WPA3_5G
channel 40
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: EZCast2-BF87F153
channel 40
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: ChinaNet-adhd-5G
channel 44
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: hichip_5G
channel 48
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: taixin
channel 52
ht[1] wpa[1] rsn[1] enc[1] security[5]
Wifi start scan req band 1 type 2 ch 14
SSID: Redmi_ttoonnyy_5G
channel 149
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: TP-LINK_5G_F502
channel 149
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: Aisteed_5G
channel 149
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: QT_TP-LINK_5G_A746
channel 149
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: TP-LINK_5G_zhfx_2f
channel 149
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HICHIP_TEST8_5G
channel 165
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HICHIP_TEST0
channel 157
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: Trainner_5G
channel 157
ht[1] wpa[0] rsn[1] enc[1] security[4]
SSID: XuanYuan_Meeting-5G
channel 157
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HICHIP_TEST4
channel 157
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: HICHIP_TEST111_5G
channel 161
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: TP-LINK_5G_A422
channel 161
ht[1] wpa[1] rsn[1] enc[1] security[5]
SSID: hcck_5G
channel 161
ht[1] wpa[1] rsn[1] enc[1] security[5]
Wifi start scan req band 1 type 5 ch 10
scan fail again [10]s, scan_no_connect=1
wait scan done--,scan_ret.len(44)
[atbm_wifi_scan_network_vif][299]free scan_ret.info
wait scan done,pScanResult->count(44)
scan_result
wifi_drv scan_result <ifname>
#wifi_drv scan_result wlan0
argc : 2
[atbm_wx_get_scan][1007]count=44
ssid == 0 not support
[atbm_wx_get_scan][1024]length=2067
[wifi_drv_get_scan_results][368] res_buf =
bssid / frequency / signal level / flags / ssid
00:24:fe:a6:77:73 2412 -41 3 Germany
46:f9:71:32:41:7e 2412 -60 5 HQGuest
8c:53:c3:8a:93:e9 2412 -40 5 qt_Xiaomi_93E7
14:d8:64:6e:f5:03 2412 -67 0 TP-LINK_F502
68:77:24:7d:db:ba 2412 -38 5 TP-LINK_WPA3
42:5f:ec:df:17:8e 2422 -38 0 2.4G_OK_Guest
42:5f:ec:df:17:8c 2422 -40 4 \xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95
a4:1a:3a:57:a4:22 2437 -37 5 TP-LINK_A422
6c:c2:42:7b:d1:4f 2437 -53 5 ChinaNet-adhd
b0:39:56:df:7c:15 2437 -41 4 iserver_haiqi
54:75:95:15:fa:ad 2437 -62 5 KunPeng_Meeting
56:75:95:15:fa:ad 2437 -61 5 HiChip\xe8\xae\xbf\xe5\xae\xa2-KP
f0:2f:74:c4:98:38 2442 -55 4 Trainner
50:d2:f5:ee:b5:25 2447 -55 5 hcck
fc:a0:5a:11:68:ae 2447 -44 5 OrayBox-2.4G-68AC
f4:6d:2f:dc:c2:d3 2462 -41 5 HICHIP_TEST111
74:39:89:e7:9d:42 2462 -15 5 hichip
7a:39:89:e7:9d:42 2462 -15 5 Hichiptech
5c:02:14:7a:18:fa 2462 -16 4 Redmi_ttoonnyy
8c:a6:df:5c:b0:23 2462 -31 5 XuanYuan_Meeting
c0:61:18:0a:b5:16 2462 -44 5 TP-LINK_0AB516_qt_ed
98:97:cc:57:07:fb 5180 -41 5 sw6-5G
24:9f:4f:df:5a:55 5180 -87 4 XuanWu_Guest_5G
42:5f:ec:df:17:90 5180 -52 4 \xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95_5G
42:5f:ec:df:17:9b 5180 -52 4 \xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95_5G_Wi-Fi5
68:77:24:7d:db:bc 5200 -55 5 TP-LINK_WPA3_5G
d2:c0:bf:87:f1:53 5200 -86 4 EZCast2-BF87F153
6c:c2:42:7b:d1:50 5220 -60 5 ChinaNet-adhd-5G
74:39:89:e7:9d:47 5240 -28 5 hichip_5G
d6:31:27:86:93:fb 5260 -88 5 taixin
5c:02:14:7a:18:f9 5745 -24 4 Redmi_ttoonnyy_5G
14:d8:64:6e:f5:04 5745 -76 5 TP-LINK_5G_F502
4c:ed:fb:7f:98:64 5745 -60 4 Aisteed_5G
34:f7:16:74:a7:48 5745 -61 5 QT_TP-LINK_5G_A746
a4:1a:3a:fd:56:fa 5745 -89 5 TP-LINK_5G_zhfx_2f
b4:0f:3b:f5:6c:f5 5825 -81 5 HICHIP_TEST8_5G
44:f9:71:22:41:80 5785 -84 5 HICHIP_TEST0
f0:2f:74:c4:98:3c 5785 -70 4 Trainner_5G
8c:a6:df:5c:b0:25 5785 -42 5 XuanYuan_Meeting-5G
00:5c:c2:74:9b:f3 5785 -80 5 HICHIP_TEST4
f4:6d:2f:dc:c2:d5 5805 -57 5 HICHIP_TEST111_5G
a4:1a:3a:57:a4:24 5805 -54 5 TP-LINK_5G_A422
50:d2:f5:ee:b5:24 5805 -86 5 hcck_5G
sta_connect
wifi_drv sta_connect <ifname> <ssid> <psk>
# wifi_drv sta_connect wlan0 garjim 12345678
argc : 4
[atbm_wx_set_connect][1060]ssid_length=6
[atbm_wx_set_connect][1074]pw_length=8
[atbm_wx_set_connect][1079] ssid=garjim,pw=12345678
[atbm_wifi_off_vif][198] i32current_mode = 6
[atbm_wpa_event_process][261]
[__atbmwifi_stop_wifimode][3229]stop_type = 6
[__atbmwifi_stop_wifimode][3237]exit
[atbm_wpa_event_process][263]
[atbm_wifi_off_vif][200]
current mode = 6
[atbm_wx_set_connect][1086]
atbmwifi_start_wifimode:other_alive_if(0),all_alive_if(0)
[atbm_wx_set_connect][1100] exit
[atbm_scan_work] atbmwifi_scan_start
Wifi start scan req band 0 type 0 ch 13
hc1600a@dbA5100v31# [atbm_wifi] connect AP have been Scanned
[atbm_wifi] connect AP have been Scanned
sta_join_work
wsm_join
sta_join_ ATBM_IEEE80211_STYPE_AUTH
set_suites: rsn
p(16),g(16),k(2)
wpa[2],key_mgmt[2],privacy[1],auth_alg[0]
[sta]:send STYPE_AUTH
send_auth alg(0),transaction(1),ielen(0)
[sta]:send ASSOC_REQ
atbmwifi_rx_assoc_rsp
RX AssocRsp (capab=0x1431 status=0 aid=4)
atbm_sta_supp_rate:flags[1],supp_rate[fff][fff],ht_flags[ff],vht_flags[0],he_flags[0]
connectap success ret=0
WPA: RX M1/4-Way Handshake from 0e:96:fa:ee:87:70 (ver=2)
RSN: M1/4 key data
WPA: Tx EAPOL-Key 2/4.....
WPA: Tx EAPOL-Key 2/4
[TX] wpa_state 7.assoc_ok 1
WPA: RX M3/4-Way Handshake from 0e:96:fa:ee:87:70 (ver=2)
WPA: Sending EAPOL-Key 4/4
WPA:install ptk
4 and 2 way handshake done!!!!
[TX] wpa_state 9.assoc_ok 1
[atbmwifi_event_uplayer][95] STA ATBM_WIFI_ENABLE_NET_EVENT
[atbm_sock_send][2047]sock=13,ctrl_sock=10
[atbm_sock_send][2054]
[atbm_sock_send][2061] buf=WPACTRL-EVENT-CONNECTED
dhcp start
[wifi_drv_ctrl_thread][983]
recv msg= WPACTRL-EVENT-CONNECTED
连接成功后udhcpc分配IP地址
# net dhclient wlan0
tx+++++
hc1600a@dbA5100v31# tx+++++
AMPDU[0]:action[0],tid[0],ssn[1],buff_size[64],token[0],0e:96:fa:ee:87:70
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
AMPDU[0]:action[2],tid[0],ssn[3],buff_size[0],token[0],0e:96:fa:ee:87:70
AMPDU[0]:action[4],tid[0],ssn[0],buff_size[64],token[0],0e:96:fa:ee:87:70
# net ifconfig
p2p0 ip:0.0.0.0 netmask:0.0.0.0 gateway:0.0.0.0
HWaddr 92:31:4b:ff:ee:d5 MTU:1500 Stop Link Down
wlan0 ip:192.168.217.206 netmask:255.255.255.0 gateway:192.168.217.11
HWaddr 90:31:4b:ff:ee:d5 MTU:1500 Running Default Link UP
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
HWaddr 00 MTU:0 Running Link UP
sta_disconnect
wifi_drv sta_disconnect <ifname>
# wifi_drv sta_disconnect wlan0
argc : 2
[atbm_wx_set_connect][1060]ssid_length=0
[atbm_wifi_off_vif][198] i32current_mode = 0
[atbm_wpa_event_process][261]
[__atbmwifi_stop_wifimode][3229]stop_type = 0
[atbmwifi_stop_sta][1514]
[atbmwifi_event_uplayer][102] STA ATBM_WIFI_DISENABLE_NET_EVENT
[atbm_sock_send][2036] fail sock=-1,ctrl_sock=8
atbmwifi_del_key err (0 2)
wpa_supplicant_event_disassoc 526
wpa_s->wpa_state =9
tx drop ret=-2
wpa_deauthen
atbm_reorder_func_reset.
[atbmwifi_stop_sta][1548]
[atbm_wx_set_connect][1100] exit
[atbmwifi_stop_sta][1560]
All Interface is down
[__atbmwifi_stop_wifimode][3237]exit
[atbm_wpa_event_process][263]
[atbm_wifi_off_vif][200]
get_status
wifi_drv get_status <ifname> <mode>
# wifi_drv get_status wlan0 1
argc : 3
result =
Mode=station
Wpa_state=COMPLETED
Channel=06
SSID=garjim▒
Key_mgmt=KEY_WPA2
BSSID=5e:1a:f4:a0:b2:d4
query key = Wpa_state
query key = Channel
query key = SSID
query key = Key_mgmt
query key = Mode
query key = BSSID
status: 0
freq: 2437
ssid: garjim▒
bssid: 5e:1a:f4:a0:b2:d4
key_mgmt: KEY_WPA2
Mode: station
wpa_state: COMPLETED
get_connect
wifi_drv get_connect <ifname>
# wifi_drv get_connect wlan0
argc : 2
result =
Mode=station
Wpa_state=COMPLETED
Channel=06
SSID=garjim
Key_mgmt=KEY_WPA2
BSSID=5e:1a:f4:a0:b2:d4
query key = Wpa_state
wpa_state: COMPLETED
[cmd_wifi_get_connect_status][1132] wlan0 connected
get_signal
wifi_drv get_signal <ifname>
# wifi_drv get_signal wlan0
argc : 2
result = Channel=06
Rssi=-29
LinkSpeed=01
query key = Channel
query key = Rssi
query key = LinkSpeed
linkspeed: 1
frequency: 2437
rssi: -29
softap
- net ifconfig wlan0 192.168.68.1 gateway 192.168.68.1 netmask 255.255.255.0 配置IP地址
- net ifconfig wlan0 up 启动WiFi网卡
- net udhcpd start wlan0 192.168.68.2 10 启动udhcpd服务器并设置起始地址和终止地址
- wifi_drv ctrl_thread wlan0 启动事件监控
ap
wifi_drv ap <ifname> <enable/disable> <channel>
# wifi_drv ap wlan0 enable 6
argc : 4
[cmd_wifi_ap_enable_cmd][834] channel = 6
[cmd_wifi_ap_enable_cmd][836] freq = 2437
[atbm_ap_set][1799] extra = ssid=atbm_test
[atbm_wext_ap_set_ssid][1634] extra = atbm_test
[atbm_wext_ap_set_ssid][1644] exit
[atbm_ap_set][1799] extra = ch=6
[atbm_wext_ap_set_ch][1691] extra = 6
[atbm_ap_set][1799] extra = password=12345678
[atbm_wext_ap_set_pw][1658] extra = 12345678
[atbm_wext_ap_set_pw][1668] exit
[atbm_ap_set][1799] extra = auth_mode=128
[atbm_wext_ap_set_auth_mode][1679] extra = 128
[atbm_ap_set][1799] extra = enable=1
[atbm_wext_ap_enable][1604]extra=1
atbmwifi_start_ap++
atbmwifi_start_wifimode:other_alive_if(0),all_alive_if(0)
wifi_StartAP_vif @@@@ if_id=0, scan.if_id=0
hostapd key_mgmt(2) wpa(2)
wpa_comm_init_extra_ie len (22),proto(ATBM_WPA_PROTO_RSN)
hostapd(atbm_test)(2 16) start to beacon
[AP] ch: 6(0), bcn: 100(3), brt: 0xf, ssid: atbm_test 0
[atbmwifi_event_uplayer][52] ATBM_WIFI_ENABLE_NET_EVENTtx+++++
dhcpd start
hostapd_init_wps
wps init end
[atbm_wext_ap_enable][1620]ret=0
ap_get
wifi_drv ap_get <ifname>
# wifi_drv ap_get wlan0
argc : 2
[atbm_ap_get][1163]le=1
[atbm_ap_get][1179]extra=Status=01
Channel=06
Sta_num=00
SSID=atbm_test
result = Status=01
Channel=06
Sta_num=00
SSID=atbm_test
query key = Status
query key = Channel
query key = Sta_num
query key = SSID
status: 1
channel: 6
num_sta: 0
ssid: atbm_test
对端连接热点
# [AP] STA added, link_id: 1
ap:rx_auth:alg(0),tran(1),status(0),fc(b0)
send_auth alg(0),transaction(2),ielen(0)
atbm: atbmwifi_rx_ap_auth(), ms=176044
ATBM_IEEE80211_STYPE_ASSOC_REQ 1
ATBM_IEEE80211_STYPE_ASSOC_REQ 2
uapsd_support_queues=0,max_sp=0
atbm_is_40m [0],sta_supp_40m [0],sta_chtype[1]
atbm_sta_supp_rate:flags[1],supp_rate[fff][fff],ht_flags[ff],vht_flags[81fbc1c0],he_flags[8040ed54]
[ap]:assoc OK 1
hostapd_4way_start
2/4 ok
wpa_receive: MIC OK
4/4 ok
hostapd err Timeout 2 wpa_ptk_state 7 group_state 3
tx+++++
AMPDU[0]:action[2],tid[0],ssn[3],buff_size[0],token[0],5e:33:12:9d:06:e6
AMPDU[0]:action[0],tid[0],ssn[1],buff_size[64],token[0],5e:33:12:9d:06:e6
AMPDU[0]:action[4],tid[0],ssn[0],buff_size[64],token[0],5e:33:12:9d:06:e6
AMPDU[0]:action[0],tid[7],ssn[1],buff_size[64],token[1],5e:33:12:9d:06:e6
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
tx+++++
p2p
- net ifconfig p2p0 up
- wifi_drv ctrl_thread p2p0 启动事件监控
p2p_init
wifi_drv p2p_init <ifname>
# wifi_drv p2p_init p2p0
argc : 2
[atbm_p2p_set] extra = intent=0
[atbm_p2p_set_intent] intent = 0
[atbm_p2p_set] extra = op_ch=1
[atbm_p2p_set_op_ch] op_ch = 1
[atbm_p2p_set] extra = listen_ch=1
[atbm_p2p_set_listen_ch] listen_ch = 1
[atbm_p2p_set] extra = setDN=hccast_atbm_p2p_lisa
[atbm_p2p_setDN] hccast_atbm_p2p_lisa 20
[atbm_p2p_set] extra = persistent=1
[atbm_p2p_set_persistent] data = 1
[atbm_p2p_set_persistent] persistent_supported = 1
p2p_listen
wifi_drv p2p <ifname> <enable/disable>
# wifi_drv p2p p2p0 enable
argc : 3
[atbm_p2p_set] extra = enable=1
[atbm_wext_p2p_enable][1378]
[p2p_main_task_creat][1078] p2p_thread=0x81fbb800 thread=0x80f25760
atbmwifi_stop_ap
hc1600a@dbA5100v31# atbmwifi_stop_ap link_id_map=0x2
tx drop ret=-6
tx drop ret=-6
tx drop ret=-6
[ap]:atbmwifi_sta_del
hostap_sta_del
[atbmwifi_event_uplayer][58] ATBM_WIFI_DISENABLE_NET_EVENTcryptoexp:1 =0ms
cryptoexp:2 =155ms
p2p
wifi_drv p2p_listen <ifname>
# wifi_drv p2p_listen p2p0
argc : 2
[atbm_p2p_set] extra = p2p_listen
priv:81fbc1c0 go_intent:0 channel:1
[atbmwifi_stop_sta][1514]
[atbmwifi_event_uplayer][102] STA ATBM_WIFI_DISENABLE_NET_EVENT
[atbm_sock_send][2036] fail sock=-1,ctrl_sock=8
atbmwifi_del_key err (0 1)
atbmwifi_del_key err (0 0)
atbmwifi_del_key err (0 2)
wpa_supplicant_event_disassoc 526
wpa_s->wpa_state =0
wpa_deauthen
atbm_reorder_func_reset.
[atbmwifi_stop_sta][1548]
[atbmwifi_stop_sta][1560]
[atbm_p2p_p2p_listen][1537]ret=0