#include "custom_runtime.h"
#include "voice_call_volte_sample_wrapper.h"
#include <los_base.h>
+#ifdef SUPPORT_CAT1_SERVICE
#include "websocket_server_manager.h"
+#endif
#include "font/ui_font.h"
namespace OHOS
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "type = %d", type);
if (AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_BT)
{
+ #ifdef SUPPORT_AI_SERVICE
streamingRecordAndSend_AI(type); // 实时发送录音数据
+ #endif
}
else if (AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
{
else if (GetSelect4gorbt() == AI_SELECT_BT)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "停止录音BT");
+ #ifdef SUPPORT_AI_SERVICE
int32_t argc = 1;
uint8_t *argv = (uint8_t *)"stop";
AudioCaptureSample(argc, (const char **)&argv);
StopStreamingRecordAndSend_AI();
+ #endif
}
uapi_save_runtime_log(RUNTIME_LOG_RECORD_STOP_AI); // TOOD*
return;
if (AiVoiceModel::GetInstance().GetInit_4gai_task())
{
uint8_t state = 0;
- // state = get_asr_is_ready_start();
+#ifdef SUPPORT_CAT1_SERVICE
state = get_asr_is_ready_start_old();
+#endif
if (state)
{
bool state = true;
}
bool AiVoiceModel::GetInit_4gai_task(void)
{
+#ifdef SUPPORT_CAT1_SERVICE
init_4gai_task = are_all_services_ready();
+#endif
return init_4gai_task;
}
#include <unordered_map> // For std::unordered_map
#ifdef SUPPORT_BLE_SERVICE
-#include <bleEvent.h>
+#include "bleEvent.h"
#include "bleService.h"
#endif
#include "NativeRegisterManager.h"
#include "aivoice/include/AiVoiceSelectView.h"
#include "graphic_service.h"
+#ifdef SUPPORT_CAT1_SERVICE
#include "websocket_server_manager.h"
+#endif
#include "custom_utils.h"
namespace OHOS
{
add_4GAI_vote(); // 4g投票
net4g_AI_init();
+ #ifdef SUPPORT_BLE_SERVICE
uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH_AI);
+ #endif
Audio::AudioManager::GetInstance().SetVolume(AUDIO_STREAM_VOICE_ASSISTANT, 100);
}
uapi_destroy_all_websocket_servers();
#endif
+ #ifdef SUPPORT_BLE_SERVICE
uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_SLOW);
+ #endif
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop end");
return;
}
#include <queue>
#include <iostream>
#include <unordered_map>
+#ifdef BLE_INSTRUCT
#include "bleInstruct.h"
+#endif
namespace OHOS
{
void CallingView::text_updata_buf(const char *buf)
{
if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1){
- SendDtfmStrNumberToCat1(buf[0]);
+ #ifdef SUPPORT_CAT1_SERVICE
+ SendDtfmStrNumberToCat1(buf[0]);
+ #endif
}
else{
- uapi_hfp_send_DTMF_CODE(buf[0]);
+ #ifdef SUPPORT_HFP_SERVICE
+ uapi_hfp_send_DTMF_CODE(buf[0]);
+ #endif
}
char new_buf[16]={0};
const char*text_buf=label_number->GetText();
sprintf_s(new_buf,16,"%s%s",text_buf,buf);
label_number->SetText(new_buf);
- RootView::GetInstance()->Invalidate();
+ RootView::GetInstance()->Invalidate();
return;
}
//cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+ #ifdef SUPPORT_CAT1_SERVICE
cat1_call_hungup_timer();
+ #endif
}
if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
{
//cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+ #ifdef SUPPORT_CAT1_SERVICE
cat1_call_hungup_timer();
+ #endif
return true;
//#endif
if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
{
- //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
- cat1_call_hungup_timer();
+ #ifdef SUPPORT_CAT1_SERVICE
+ cat1_call_hungup_timer();
+ #endif
- return true;
- //#endif
+ return true;
}else
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::phone calling");
if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
{
+ #ifdef SUPPORT_CAT1_SERVICE
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 ");
cat1_call_answer();
+ #endif
return true;
//#endif
// 加载Message文件
bool MessageModel::LoadMessagesFromStorage() {
// 加载消息过滤文件
+ #ifdef SUPPORT_BLE_SERVICE
filtration_file_read();
+ #endif
std::ifstream file(MESSAGE_JSON_FILE);
if (!file.is_open()) {
// 保存Message文件
bool MessageModel::SaveMessagesToStorage() {
// 消息过滤文件保存
+ #ifdef SUPPORT_BLE_SERVICE
filtration_file_save();
+ #endif
if (MessageVector.empty()) {
// 清空文件
std::ofstream file(MESSAGE_JSON_FILE,
if(get_address_number())
{
- // if(uapi_cat1_get_power_stat()==0 ||
+ #ifdef SUPPORT_CAT1_SERVICE
if(uapi_dev_runtime_get_cat1_simstat()==0)
{
DialingMethodView::GetInstance()->fail_Dial_show(0);
{
cat1_UI_call_dial(get_address_number());
}
-
+ #endif
}
else
{
- // if(uapi_cat1_get_power_stat()==0 ||
+ #ifdef SUPPORT_CAT1_SERVICE
if(uapi_dev_runtime_get_cat1_simstat()==0)
{
DialingMethodView::GetInstance()->fail_Dial_show(0);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_cat1_get_power_stat");
NativeAbility::GetInstance().EnterSlice(VIEW_PHONECALL);
}
-
+ #endif
}
}
if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGWATCHSIM)\r
{\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DIALINGMETHOD_USINGWATCHSIM");\r
+ #ifdef SUPPORT_CAT1_SERVICE\r
cat1_UI_call_dial((char *)phoneNumber.c_str());\r
+ #endif\r
\r
}\r
else if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGPHONE)\r
-/*
- * @Author: luozheng 1732036298@qq.com
- * @Date: 2024-06-20 15:11:17
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-24 20:17:39
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/RebootAndShutdownPresenter.cpp
- */
#include "AppViewIDs.h"
#include "NativeAbility.h"
#include "common/key_code.h"
-/*\r
- * @Author: luozheng 1732036298@qq.com\r
- * @Date: 2024-06-20 15:11:17\r
- * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-12-13 16:28:48\r
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/SchedulePresenter.cpp\r
- */\r
#include "AppViewIDs.h"\r
#include "NativeAbility.h"\r
#include "common/key_code.h"\r
#endif
/*运动结束并且是手表发起的运动*/
if (Openingway == false) {
+ #ifdef SUPPORT_BLE_SERVICE
sendtraningstateend();
+ #endif
}
/*运动结束并且是app发起的运动*/
else {
- sendtraningstatedata(0, sportdata->duration);
+ #ifdef SUPPORT_BLE_SERVICE
+ sendtraningstatedata(0, sportdata->duration);
+ #endif
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "结束运动");
MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_TO_WATCH);
MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_TO_PHONE);
MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_HINT);
- // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_UPDATE);
- // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE);
+
+ #ifdef SUPPORT_CYWEE_SERVICE
MsgCenterSubscribeTopic(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE);
MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_UPDATE);
- // MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE);
+ #endif
MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRAINING);
MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRANSMIT);
MsgCenterSubscribeTopic(TOPIC_EVENT_GOAL_SHOW_VIEW);
//APP运动相关
void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req)
{
+ #ifdef SUPPORT_BLE_SERVICE
unused(topic);
uint8_t* data=(uint8_t*)req->data;
if(data!=NULL && req->len>=2)
break;
}
}
-
- // unused(req);
-
+ #endif
}
#include "cat1_server.h"
#include "cat1_ctl.h"
#include "cat1_porting.h"
+#include "cat1_UI_hal.h"
#endif
#include "custom_runtime.h"
-#include "cat1_UI_hal.h"
#include "custom_utils.h"
#include "phone/include/phoneaddressmodel.h"
#include "components/ui_label_button.h"
//结束通话运行
void sos_falg_add(void)
{
- if(sos_dail_falg)
+ if (sos_dail_falg)
{
- if(OHOS::get_sos_number_count()<=0)
+ if (OHOS::get_sos_number_count() <= 0)
{
#ifdef SUPPORT_CAT1_SERVICE
cat1_UI_call_dial("SOS");
return;
}
- printf("sos dial %d\r\n",sos_dail_falg);
- #if SOS_TEST_FLAG
- if(1)
- #else
- if( uapi_dev_runtime_get_cat1_simstat())
- #endif
+ printf("sos dial %d\r\n", sos_dail_falg);
+#if SOS_TEST_FLAG
+ if (1)
+#else
+ int simstat = 0;
+#ifdef SUPPORT_CAT1_SERVICE
+ simstat = uapi_dev_runtime_get_cat1_simstat();
+#endif
+ if (simstat)
+#endif
{
#ifdef SUPPORT_CAT1_SERVICE
- cat1_UI_call_dial(OHOS:: get_sos_number(sos_dail_falg));
+ cat1_UI_call_dial(OHOS::get_sos_number(sos_dail_falg));
#endif
}
- #if SOS_HFP_FALG
- else if(uapi_hfp_connect_state())
+#if SOS_HFP_FALG
+ else if (uapi_hfp_connect_state())
{
- DialCall((unsigned char *)OHOS::get_sos_number(sos_dail_falg),osal_strlen((const char*)OHOS::get_sos_number(sos_dail_falg)));
+ DialCall((unsigned char *)OHOS::get_sos_number(sos_dail_falg), osal_strlen((const char *)OHOS::get_sos_number(sos_dail_falg)));
}
- #endif
+#endif
else
{
#ifdef SUPPORT_CAT1_SERVICE
- cat1_UI_call_dial("SOS");
+ cat1_UI_call_dial("SOS");
#endif
}
sos_dail_falg++;
- if(sos_dail_falg>=OHOS::get_sos_number_count()*3)
+ if (sos_dail_falg >= OHOS::get_sos_number_count() * 3)
{
- sos_dail_falg=0;
+ sos_dail_falg = 0;
}
}
}
void start_SOS_phone_dail(void)
{
- if(OHOS::get_sos_number_count()<=0)
+ if (OHOS::get_sos_number_count() <= 0)
{
#ifdef SUPPORT_CAT1_SERVICE
cat1_UI_call_dial("SOS");
#endif
return;
}
- #if SOS_TEST_FLAG
- if(1)
- #else
- if(uapi_dev_runtime_get_cat1_simstat())
+#if SOS_TEST_FLAG
+ if (1)
+#else
+ int simstat = 0;
+ #ifdef SUPPORT_CAT1_SERVICE
+ simstat = uapi_dev_runtime_get_cat1_simstat();
#endif
+ if (simstat)
+#endif
{
#ifdef SUPPORT_CAT1_SERVICE
cat1_UI_call_dial(OHOS::get_sos_number(0));
#endif
- sos_dail_falg=1;
+ sos_dail_falg = 1;
}
- #if SOS_HFP_FALG
- else if(uapi_hfp_connect_state())
+#if SOS_HFP_FALG
+ else if (uapi_hfp_connect_state())
{
- DialCall((unsigned char *)OHOS::get_sos_number(0),osal_strlen((const char*)OHOS::get_sos_number(0)));
- sos_dail_falg=1;
+ DialCall((unsigned char *)OHOS::get_sos_number(0), osal_strlen((const char *)OHOS::get_sos_number(0)));
+ sos_dail_falg = 1;
}
- #endif
+#endif
else
{
#ifdef SUPPORT_CAT1_SERVICE
cat1_UI_call_dial("SOS");
#endif
}
-
-
}