else ifcmp("ap_") {
cstr+=3;
ifcmp("ssid") {
if(pvar[0]!='\0') {
int len = os_strlen(pvar);
if(len > sizeof(wifi_ap_cfg.ssid)) {
len = sizeof(wifi_ap_cfg.ssid);
}
else os_memset(wifi_ap_cfg.ssid, 0, sizeof(wifi_ap_cfg.ssid));
os_memcpy(wifi_ap_cfg.ssid, pvar, len);
#ifdef USE_NETBIOS
netbios_set_name(wifi_ap_cfg.ssid);
#endif
}
}
else ifcmp("psw") {
int len = os_strlen(pvar);
if(len > sizeof(wifi_ap_cfg.password)) {
len = sizeof(wifi_ap_cfg.password);
}
else os_memset(wifi_ap_cfg.password, 0, sizeof(wifi_ap_cfg.password));
os_memcpy(wifi_ap_cfg.password, pvar, len);
}
else ifcmp("chl") wifi_ap_cfg.channel = val;
else ifcmp("mcns") wifi_ap_cfg.max_sta = val;
else ifcmp("auth") wifi_ap_cfg.security_type = (val)? RTW_SECURITY_WEP_PSK : RTW_SECURITY_OPEN;
else ifcmp("hssid") wifi_ap_cfg.ssid_hidden = val;
else ifcmp("bint") wifi_ap_cfg.beacon_interval = val;
#if LWIP_NETIF_HOSTNAME
else ifcmp("hostname") {
int len = os_strlen(pvar);
if(len >= LWIP_NETIF_HOSTNAME_SIZE) {
len = LWIP_NETIF_HOSTNAME_SIZE-1;
}
os_memcpy(lwip_host_name[wlan_ap_netifn], pvar, len);
lwip_host_name[wlan_ap_netifn][len] = 0;
netbios_set_name(wlan_ap_netifn, pvar);
}
#endif
else ifcmp("dhcp") wifi_ap_dhcp.mode = val;
else ifcmp("ip") wifi_ap_dhcp.ip = ipaddr_addr(pvar);
else ifcmp("gw") wifi_ap_dhcp.gw = ipaddr_addr(pvar);
else ifcmp("msk") wifi_ap_dhcp.mask = ipaddr_addr(pvar);
#if DEBUGSOO > 2
else os_printf(" - none! ");
#endif
}
else ifcmp("st_") {
cstr+=3;
ifcmp("arec") wifi_st_cfg.autoreconnect = val;
else ifcmp("rect") wifi_st_cfg.reconnect_pause = val;
else ifcmp("ssid") {
if(pvar[0]!='\0') {
int len = os_strlen(pvar);
if(len > sizeof(wifi_st_cfg.ssid)) {
len = sizeof(wifi_st_cfg.ssid);
}
else os_memset(wifi_st_cfg.ssid, 0, sizeof(wifi_st_cfg.ssid));
os_memcpy(wifi_st_cfg.ssid, pvar, len);
}
}
else ifcmp("psw") {
int len = os_strlen(pvar);
if(len > sizeof(wifi_st_cfg.password)) {
len = sizeof(wifi_st_cfg.password);
}
else os_memset(wifi_st_cfg.password, 0, sizeof(wifi_st_cfg.password));
os_memcpy(wifi_st_cfg.password, pvar, len);
}
else ifcmp("auth") wifi_st_cfg.security_type = val;
else ifcmp("bssid") strtomac(pvar, wifi_st_cfg.bssid);
else ifcmp("sbss") wifi_st_cfg.flg = val;
#if LWIP_NETIF_HOSTNAME
else ifcmp("hostname") {
int len = os_strlen(pvar);
if(len >= LWIP_NETIF_HOSTNAME_SIZE) {
len = LWIP_NETIF_HOSTNAME_SIZE-1;
}
os_memcpy(lwip_host_name[wlan_st_netifn], pvar, len);
lwip_host_name[wlan_st_netifn][len] = 0;
netbios_set_name(wlan_st_netifn, pvar);
}
#endif
else ifcmp("dhcp") wifi_st_dhcp.mode = val;
else ifcmp("ip") wifi_st_dhcp.ip = ipaddr_addr(pvar);
else ifcmp("gw") wifi_st_dhcp.gw = ipaddr_addr(pvar);
else ifcmp("msk") wifi_st_dhcp.mask = ipaddr_addr(pvar);