static osTimerId_t g_timer_time_Dial = NULL;
+#define DIAL_OVERTIME 3000
+
+void cat1_rep_call_dial(void);
+
+static uint8_t dial_count=0;
/**如果
* g_python_updated == 0 &&
* g_py_ver >= PY_SRV_VER_SUPORT_PY_OTA_MINI_VER &&
{
udp_send_msg_toCat1(UDP_CMD_CAT1_OTA_UPDATE,url);
}
+
+static char *dial_phonenum=NULL;
+
+void cat1_rep_call_dial(void)
+{
+ bool volte = OHOS::ConfigModel::GetInstance()->GetVoLTE_Call();
+ if (volte == true){
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"cat1_call_dial %s\n",dial_phonenum);
+ // #if PY_SRV_VER_CURRENT >=16
+ if(g_py_ver>=16)
+ {
+ if(osTimerIsRunning(g_timer_time_Dial)==0 )
+ {
+ osStatus_t ret = osTimerStart(g_timer_time_Dial,5000);
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 g_timer_time_Dial timer ret %d\n",ret);
+ }
+ }
+ udp_send_msg_toCat1(UDP_CMD_DIAL_NUMB,dial_phonenum);
+ }
+
+
+}
void cat1_call_dial(char* phonenum)
{
{
if(osTimerIsRunning(g_timer_time_Dial)==0 )
{
- osStatus_t ret = osTimerStart(g_timer_time_Dial,5000);
+ osStatus_t ret = osTimerStart(g_timer_time_Dial,DIAL_OVERTIME);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 g_timer_time_Dial timer ret %d\n",ret);
}
}
+
// #endif
+ if(dial_phonenum)
+ free(dial_phonenum);
+
+ dial_phonenum=(char *)malloc(strlen(phonenum)+1);
+ memset(dial_phonenum,0,strlen(phonenum)+1);
+ memcpy_s(dial_phonenum,30,phonenum,strlen(phonenum));
+ dial_count=0;
udp_send_msg_toCat1(UDP_CMD_DIAL_NUMB,phonenum);
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"time_answer_func\n");
cat1_handle_call_disconnected("callfail");
}
+#define CAT1_DAIL_REP
+#define CAT1_DAIL_REP_COUNT 1
//电话接听超时
static void time_dial_func(void)
{
osTimerStop(g_timer_time_Dial);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"time_dial_func\n");
+ #ifdef CAT1_DAIL_REP
+ if(dial_count<CAT1_DAIL_REP_COUNT)
+ {
+ cat1_rep_call_dial();
+ dial_count++;
+ }
+ else
+ {
+
+ #else
cat1_handle_call_disconnected("callfail");
+ #endif
+
+ }
+
}
int cat1_handle_call_connected(char* phonenum)
--- /dev/null
+#include "custom_runtime.h"
+#include "chip_system_time.h"
+#include <stdint.h>
+
+#include "audio_base_type.h"
+
+typedef enum
+{
+ TYPE_DEFAULT = -1,
+ /** Media */
+ TYPE_PHONE = 0,
+}Audio_runtime_status;
+
+
+typedef enum
+{
+ TYPE_DEFAULT = 0,
+ /** Media */
+ TYPE_WATCH ,
+ TYPE_A2DP ,
+ TYPE_HFP,
+}Audio_Output_type;
+
+typedef enum
+{
+ TYPE_DEFAULT = -1,
+ /** Media */
+ TYPE_A2DP = 0,
+ TYPE_HFP,
+ TYPE_HFP,
+}Audio_Input_type;
+
+typedef struct
+{
+ AudioStreamType AudioStreamType;
+ Audio_runtime_status runtime_status;
+ char *source;
+ Audio_Input_type Input_type;
+ Audio_Output_type Output_type;
+ bool mixture;
+}Audio_status_t;
+
+
+static Audio_status_t g_audio_gate={0};
+
+
+void uapi_updata_audio_gate(uint32_t AudioStreamType,uint32_t runtime_status,bool mixture)
+{
+ g_audio_gate.AudioStreamType=AudioStreamType;
+ g_audio_gate.runtime_status=runtime_status;
+ g_audio_gate.mixture=mixture;
+}
+
+
+void uapi_updata_audio_gate_source(char *source)
+{
+ if( g_audio_gate.source)
+ {
+ free(g_audio_gate.source);
+ g_audio_gate.source=NULL;
+ }
+ g_audio_gate.source=(char *)malloc(strlen(source)+1);
+ memset(g_audio_gate.source,0,strlen(source)+1);
+ memcpy(g_audio_gate.source,source,strlen(source)+1);;
+
+}
+
+void uapi_updata_audio_gate_type(uint32_t Input_type,uint32_t Output_type)
+{
+ g_audio_gate.Input_type=Input_type;
+ g_audio_gate.Output_type=Output_type;
+}
+
+
+uint32_t uapi_get_gate_AudioStreamType_status(void)
+{
+ return g_audio_gate.AudioStreamType;
+}
+
+bool uapi_get_gate_mixture_status(void)
+{
+ return g_audio_gate.mixture;
+}
\ No newline at end of file