|
|
@@ -1110,7 +1110,7 @@ static int proc_cellular(dictionary *dic, int op, CellInfo_t *cell)
|
|
|
|
|
|
return r;
|
|
|
}
|
|
|
-static int proc_wifi(dictionary *dic, int op, WIFIManager *pWIFIManager)
|
|
|
+static int proc_wifi(dictionary *dic, int op, WIFIInfo_t *pWIFIManager)
|
|
|
{
|
|
|
int r=0;
|
|
|
char temp[100];
|
|
|
@@ -1135,6 +1135,26 @@ static int proc_wifi(dictionary *dic, int op, WIFIManager *pWIFIManager)
|
|
|
|
|
|
}
|
|
|
|
|
|
+ token = "wifi:enable";
|
|
|
+ if(op==PARAS_READ) {
|
|
|
+ r = iniparser_getint(dic, token, -1);
|
|
|
+ if(r==-1) {
|
|
|
+ LOGE("___ iniparser_getint %s failed\n", token);
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ pWIFIManager->WIFI_enable = r;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ /*
|
|
|
+ sprintf(temp, "%d", pWIFIManager->WIFI_enable);
|
|
|
+ r = iniparser_set(dic, token, temp);
|
|
|
+ if(r) {
|
|
|
+ LOGE("___ iniparser_set %s failed\n", token);
|
|
|
+ return -1;
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+
|
|
|
token = "wifi:mode";
|
|
|
if(op==PARAS_READ) {
|
|
|
r = iniparser_getint(dic, token, -1);
|
|
|
@@ -3655,7 +3675,7 @@ static int ini_reset(paras_handle_t *h)
|
|
|
fprintf(fp, "\n");
|
|
|
|
|
|
fprintf(fp, "[cellular]\n");
|
|
|
- fprintf(fp, "enable = \"%d\"\n", info->cell.Cellular_enable);
|
|
|
+ fprintf(fp, "enable = \"%d\"\n", info->cell.Cellular_enable);
|
|
|
fprintf(fp, "mode = \"%d\"\n", info->cell.mode);
|
|
|
fprintf(fp, "apn = \"%s\"\n", info->cell.apn);
|
|
|
fprintf(fp, "username = \"%s\"\n", info->cell.username);
|
|
|
@@ -3663,6 +3683,7 @@ static int ini_reset(paras_handle_t *h)
|
|
|
fprintf(fp, "\n");
|
|
|
|
|
|
fprintf(fp, "[wifi]\n");
|
|
|
+ fprintf(fp, "enable = \"%d\"\n", info->wifi.WIFI_enable);
|
|
|
fprintf(fp, "mode = \"%d\"\n", info->wifi.mode);
|
|
|
fprintf(fp, "ip = \"%s\"\n", info->wifi.WIFI_ip);
|
|
|
fprintf(fp, "ssid = \"%s\"\n", info->wifi.WIFI_name);
|