CAT1_SERVICE_HEAD = 'FE' #固定head
PROJECT_NAME = "Cat1SlipUDPService"
-PROJECT_VERSION = "PY_SRV_V12"
+PROJECT_VERSION = "PY_SRV_V13"
CONFIG_JSON="/usr/system_config.json"
CURRENT_APP_TYPE="pysrv"
if (app_type == "pymain"):
return "PY_MAIN_V2"
elif (app_type == "pyota"):
- return "PY_OTA_V11"
+ return "PY_OTA_V13"
elif (app_type == "pysrv"):
- return "PY_SRV_V11"
+ return "PY_SRV_V13"
#如果没有configfile则创建它
if not ql_fs.path_exists(CONFIG_JSON):
return 0
# 电话接听消息
- def notifyConnecteCall(self):
+ def notifyConnecteCall(self, phone_numb):
self.clear_remain()
__head = '0A'
- self.__message = '0'
+ self.__message = str(phone_numb)
self.__Socket_UDP(__head, self.__message)
# if self.__err == 1 or self.__value[2] != 'OK':
# return -1
return 0
# 电话拒接消息
- def notifyDisconnectCall(self):
+ def notifyDisconnectCall(self, phone_numb):
self.clear_remain()
__head = '0B'
- self.__message = '0'
+ self.__message = str(phone_numb)
self.__Socket_UDP(__head, self.__message)
# if self.__err == 1 or self.__value[2] != 'OK':
# return -1
elif args[0] == 11:
if eventMesh.publish("get_volte_switch") == 1: #开启VOLTE功能
print('voicecall connected, PhoneNO: ', args[6])
- cat1service.notifyConnecteCall()
+ cat1service.notifyConnecteCall(args[6])
elif args[0] == 12:
print('voicecall disconnect')
if eventMesh.publish("get_volte_switch") == 1: #开启VOLTE功能
- cat1service.notifyDisconnectCall()
+ print('voicecall disconnected, PhoneNO: ', args[6])
+ cat1service.notifyDisconnectCall(args[6])
elif args[0] == 13:
print('voicecall is waiting, PhoneNO: ', args[6])
elif args[0] == 14:
}
}
-int cat1_handle_call_connected(void)
+int cat1_handle_call_connected(char* phonenum)
{
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 call connected\n");
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 call connected %s\n",phonenum);
//声音处理
- incomedcall_event_sendmsg_toUI("ok");
+ incomedcall_event_sendmsg_toUI(phonenum);
uapi_cat1_start_volte_voice();
return 1;
}
//来电挂断处理
-int cat1_handle_call_disconnected(void)
+int cat1_handle_call_disconnected(char* phonenum)
{
- WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 call disconnected\n");
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 call disconnected %s\n",phonenum);
//TODO: 关闭声音
- callend_event_sendmsg_toUI("0k");
+ callend_event_sendmsg_toUI(phonenum);
uapi_cat1_stop_volte_voice();
return 1;
}
index = cat1_handle_timesync(msg_buffer);
break;
case UDP_MSG_CALL_CONNECTED:
- index = cat1_handle_call_connected();
+ index = cat1_handle_call_connected(msg_buffer);
break;
case UDP_MSG_CALL_DISCONNECTED:
- index = cat1_handle_call_disconnected();
+ index = cat1_handle_call_disconnected(msg_buffer);
break;
case UDP_CMD_CAT1_OTA_UPDATE:
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"CAT1_OTA_UPDATE reply %s\n",msg_buffer);