mirror of
https://github.com/pvvx/RTL00_WEB.git
synced 2025-07-31 20:31:05 +00:00
update
This commit is contained in:
parent
fb8cc58058
commit
0cefdb9956
6 changed files with 40 additions and 15 deletions
|
@ -468,6 +468,15 @@ int wext_get_tx_power(const char *ifname, __u8 *poweridx) {
|
|||
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 ?
|
||||
int wext_set_txpower(const char *ifname, int poweridx) {
|
||||
int ret;
|
||||
|
@ -481,18 +490,6 @@ int wext_set_txpower(const char *ifname, int poweridx) {
|
|||
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,
|
||||
rtw_security_t* security) {
|
||||
int ret = 0;
|
||||
|
|
|
@ -866,3 +866,28 @@ void show_wifi_cfg(void) {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -152,6 +152,7 @@ void show_wifi_st_ip(void);
|
|||
void show_wifi_cfg(void);
|
||||
void show_wifi_st_cfg(void);
|
||||
void show_wifi_ap_cfg(void);
|
||||
int show_wifi_ap_clients(void);
|
||||
uint32 read_wifi_cfg(uint32 flg);
|
||||
uint32 write_wifi_cfg(uint32 flg);
|
||||
int wifi_run(rtw_mode_t mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue