[Feature][S300AI][task-view-1715][AT] sync AT+CMD & AT+WLAN_PARAMETER?
Change-Id: I535fd4dbce1c59df597ea8687abed9c4a00756e2
diff --git a/lynq/S300AI/ap/app/zte_comm/at_ctl/src/atconfig/extat_softap_register.c b/lynq/S300AI/ap/app/zte_comm/at_ctl/src/atconfig/extat_softap_register.c
index 1219e0d..4d8deeb 100755
--- a/lynq/S300AI/ap/app/zte_comm/at_ctl/src/atconfig/extat_softap_register.c
+++ b/lynq/S300AI/ap/app/zte_comm/at_ctl/src/atconfig/extat_softap_register.c
@@ -1062,6 +1062,68 @@
return AT_END;
}
+int ext_at_common_command_func(char *at_paras, void ** res_msg)
+{
+ int ret = 0;
+ char *at_str = malloc(1024);
+ char command[256] = {0};
+ char result[256] = {0};
+ void *p[] = {command};
+
+ ret = parse_param("%255s", at_paras, p);
+ if (ret != AT_PARSE_OK)
+ {
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
+
+ executeCommand(command, result, sizeof(result));
+ snprintf(at_str, 1024, "\r\n+CMD:%s\r\nOK\r\n", result);
+ *res_msg = at_str;
+
+ return AT_END;
+}
+
+int ext_at_wlan_parameter_func(char *at_paras, void ** res_msg)
+{
+ int i = 0;
+ char calibrate_result[1024] = {0};
+ char temp_result[128] = {0};
+ char *at_str = malloc(1024);
+ char *wlan_calibration_list[12] = {
+ "iwpriv wlan0 efuse_get HW_TX_POWER_CCK_A",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_CCK_B",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_HT40_1S_A",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_HT40_1S_B",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT20_A",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT20_B",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT20_OFDM_A",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT20_OFDM_B",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT40_2S_A",
+ "iwpriv wlan0 efuse_get HW_TX_POWER_DIFF_HT40_2S_B",
+ "iwpriv wlan0 efuse_get HW_11N_THER",
+ "iwpriv wlan0 efuse_get HW_11N_XCAP",
+ };
+
+ for(i = 0; i < sizeof(wlan_calibration_list)/sizeof(wlan_calibration_list[0]); i++)
+ {
+ executeCommand(wlan_calibration_list[i], temp_result, sizeof(temp_result));
+
+ if (strlen(temp_result) > 0)
+ {
+ strncat(calibrate_result, temp_result, sizeof(calibrate_result) - strlen(calibrate_result) - 1);
+ strncat(calibrate_result, "\r\n", sizeof(calibrate_result) - strlen(calibrate_result) - 1);
+ }
+
+ memset(temp_result, 0, sizeof(temp_result));
+ }
+
+ snprintf(at_str, 1024, "\r\n+WLAN_PARAMETER:\r\n%s\r\nOK\r\n", calibrate_result);
+ *res_msg = at_str;
+
+ return AT_END;
+}
+
void ext_notelcom_regist()
{
register_serv_func2("ZWIFI=", MODULE_ID_WIFI,
@@ -1106,6 +1168,8 @@
register_serv_func("WLAN_SS", 0, ext_at_wlan_ss_func);
register_serv_func("FMTEST=", 0, ext_at_delay_shut_down_func);
register_serv_func("BATTERY_VOICE=", 0, ext_at_battery_voice_voltage_func);
+ register_serv_func("CMD=", 0, ext_at_common_command_func);
+ register_serv_func("WLAN_PARAMETER?", 0, ext_at_wlan_parameter_func);
}
void at_comm_init(void)