This commit is contained in:
pvvx 2017-07-31 17:40:43 +03:00
parent fb8cc58058
commit 0cefdb9956
6 changed files with 40 additions and 15 deletions

View file

@ -468,6 +468,15 @@ int wext_get_tx_power(const char *ifname, __u8 *poweridx) {
return ret; return ret;
} }
int wext_get_associated_client_list(const char *ifname,
void * client_list_buffer, uint16_t buffer_length) {
char buf[25];
memset(buf, 0, sizeof(buf));
snprintf(buf, 25, "get_client_list %x", client_list_buffer);
return wext_private_command(ifname, buf, 0);
}
#if 0 // work ? #if 0 // work ?
int wext_set_txpower(const char *ifname, int poweridx) { int wext_set_txpower(const char *ifname, int poweridx) {
int ret; int ret;
@ -481,18 +490,6 @@ int wext_set_txpower(const char *ifname, int poweridx) {
return ret; return ret;
} }
int wext_get_associated_client_list(const char *ifname,
void * client_list_buffer, uint16_t buffer_length) {
int ret;
char buf[25];
memset(buf, 0, sizeof(buf));
snprintf(buf, 25, "get_client_list %x", client_list_buffer);
ret = wext_private_command(ifname, buf, 0);
return ret;
}
int wext_get_ap_info(const char *ifname, rtw_bss_info_t * ap_info, int wext_get_ap_info(const char *ifname, rtw_bss_info_t * ap_info,
rtw_security_t* security) { rtw_security_t* security) {
int ret = 0; int ret = 0;

View file

@ -866,3 +866,28 @@ void show_wifi_cfg(void) {
printf("\tSave flags: %p\n", wifi_cfg.save_flg); printf("\tSave flags: %p\n", wifi_cfg.save_flg);
} }
int show_wifi_ap_clients(void) {
if((wifi_mode == RTW_MODE_AP) || (wifi_mode == RTW_MODE_STA_AP)) {
struct {
int count;
rtw_mac_t mac_list[AP_STA_NUM];
} client_info;
client_info.count = AP_STA_NUM;
if(wext_get_associated_client_list(wlan_ap_name, &client_info, sizeof(client_info)) >= 0) {
if(client_info.count) {
printf("\tAP %u clients:\n", client_info.count);
int client_idx = 0;
while(client_idx++ < client_info.count) {
unsigned char *pmac = client_info.mac_list[client_idx].octet;
printf("\tsta[%u]: %02x:%02x:%02x:%02x:%02x:%02x\n", client_idx,
pmac[0],pmac[1],pmac[2],pmac[3],pmac[4],pmac[5]);
}
} else {
printf("\tAP clients none\n");
}
return client_info.count;
};
};
printf("Get AP clients error!\n");
return -1;
}

View file

@ -152,6 +152,7 @@ void show_wifi_st_ip(void);
void show_wifi_cfg(void); void show_wifi_cfg(void);
void show_wifi_st_cfg(void); void show_wifi_st_cfg(void);
void show_wifi_ap_cfg(void); void show_wifi_ap_cfg(void);
int show_wifi_ap_clients(void);
uint32 read_wifi_cfg(uint32 flg); uint32 read_wifi_cfg(uint32 flg);
uint32 write_wifi_cfg(uint32 flg); uint32 write_wifi_cfg(uint32 flg);
int wifi_run(rtw_mode_t mode); int wifi_run(rtw_mode_t mode);

View file

@ -191,6 +191,9 @@ LOCAL void fATWI(int argc, char *argv[]) {
printf("\nWIFI ST config:\n"); printf("\nWIFI ST config:\n");
printf(&str_rom_57ch3Dch0A[25]); // "================================\n" printf(&str_rom_57ch3Dch0A[25]); // "================================\n"
show_wifi_st_cfg(); show_wifi_st_cfg();
printf("\nWIFI AP clients:\n");
printf(&str_rom_57ch3Dch0A[25]); // "================================\n"
show_wifi_ap_clients();
printf("\n"); printf("\n");
} }

View file

@ -519,7 +519,6 @@ extern int adc_ws(TCP_SERV_CONN *ts_conn, char cmd);
else ifcmp("gw") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.gw)); else ifcmp("gw") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.gw));
else ifcmp("msk") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.mask)); else ifcmp("msk") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.mask));
else ifcmp("cip") tcp_puts(IPSTR, IP2STR(&xnetif[WLAN_ST_NETIF_NUM].ip_addr.addr)); else ifcmp("cip") tcp_puts(IPSTR, IP2STR(&xnetif[WLAN_ST_NETIF_NUM].ip_addr.addr));
// else ifcmp("mac") strtomac(pvar, wifi_ap_cfg.macaddr); // else ifcmp("mac") strtomac(pvar, wifi_ap_cfg.macaddr);
// else ifcmp("sip") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.start_ip)); // else ifcmp("sip") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.start_ip));
// else ifcmp("eip") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.end_ip)); // else ifcmp("eip") tcp_puts(IPSTR, IP2STR(&wifi_ap_dhcp.end_ip));

View file

@ -6,8 +6,8 @@ SDK_PATH = USDK/
#GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/6.2017-q1-update/bin/# + or set in PATH #GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/6.2017-q1-update/bin/# + or set in PATH
OPENOCD_PATH = D:/MCU/OpenOCD/bin/ OPENOCD_PATH = D:/MCU/OpenOCD/bin/
TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/ TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/
FLASHER_TYPE = Jlink #FLASHER_TYPE = Jlink
#FLASHER_TYPE = cmsis-dap FLASHER_TYPE = cmsis-dap
FLASHER_SPEED = 3500 FLASHER_SPEED = 3500
FLASHER_PATH = flasher/ FLASHER_PATH = flasher/
JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/ JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/