[Feature][ZXW-41] merged 0601 version

Change-Id: I667af6bb09d65581d455b73f8984c160b2c67ad8
diff --git a/ap/lib/libatext/ext_audio_func.c b/ap/lib/libatext/ext_audio_func.c
index f1b45a7..143a6d2 100755
--- a/ap/lib/libatext/ext_audio_func.c
+++ b/ap/lib/libatext/ext_audio_func.c
@@ -15,6 +15,7 @@
 #ifdef _USE_VOICE_ALSA

 #include "tinyalsa/audio_mixer_ctrl.h"

 #include "voice_lib.h"

+#include "voice_ipc.h"

 #endif

 //#include "ext_regist.h"

 //#include "softap_api.h"

@@ -479,6 +480,46 @@
 	return AT_END;

 }

 

+int extAt_CAP_VALSA_act_func (int at_fd, char * at_paras, void * *res_msg, int * res_msglen)

+{

+	char *at_str = NULL;

+	UINT32 ret = DRV_SUCCESS;

+

+	int mode = 0;

+    int enable = 0;

+	

+	UINT16 onOff = 0;

+	at_str = at_paras;

+	printf("extAt_CAP_VALSA_act_func, at_paras:%s \n", at_paras);

+

+	ret = sscanf (at_str, "%d,%d", &mode,&enable);

+	onOff = enable;

+	printf("extAt_CAP_VALSA_act_func mode=%d,enable=%d,ret=%d\n",mode,enable,ret);

+

+	if (ret == 2) {

+		if(onOff == 1)

+		{

+			ret = cap_alsa_voice_open(mode);

+			printf("extAt_CAP_VALSA_act_func alsa_voice_open,ret=%d\n",ret);

+		}

+		else

+		{

+			ret = cap_alsa_voice_close(mode);

+			printf("extAt_CAP_VALSA_act_func alsa_voice_close,ret=%d\n",ret);

+			

+		}		

+		if (ret == DRV_SUCCESS) {

+			*res_msg = at_ok_build();

+			*res_msglen = strlen (*res_msg);

+			return AT_END;

+		}

+	}

+	*res_msg = at_err_build(ATERR_PROC_FAILED);

+	*res_msglen = strlen (*res_msg);

+	

+	return AT_END;

+}

+

 #endif

 

 void ext_audio_regist_init(void)

@@ -501,6 +542,7 @@
 

 	register_serv_func2("VALSA=", 0, 0, 0, extAt_VALSA_act_func, NULL);

 	register_serv_func2("VPATH=", 0, 0, 0, extAt_VPATH_act_func, NULL);

+    register_serv_func2("CAP_VALSA=", 0, 0, 0, extAt_CAP_VALSA_act_func, NULL);

 	

 #endif

 }