添加LowPowerAlarm Notify
authorSnickerSun <snickersun@163.com>
Thu, 28 Mar 2024 10:02:50 +0000 (18:02 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 28 Mar 2024 10:02:50 +0000 (18:02 +0800)
code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h
code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp

index 7169457..82d0a9f 100755 (executable)
@@ -48,6 +48,7 @@ typedef enum {
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     TOPIC_EVENT_CHARGE_PLUG,
     TOPIC_EVENT_CHARGE_UNPLUG,
+    TOPIC_EVENT_LOWPOWER_ALARM,
 #endif
 #ifdef SUPPORT_SPO2_NOTIFICATION
     TOPIC_EVENT_SPO2_UPDATE,
index b41c00f..46f02a6 100755 (executable)
@@ -44,6 +44,7 @@ static const TopicToCore topicToCoreArray[] = {
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     {TOPIC_EVENT_CHARGE_PLUG, A_CORE_MASK, 1},
     {TOPIC_EVENT_CHARGE_UNPLUG, A_CORE_MASK, 1},
+    {TOPIC_EVENT_LOWPOWER_ALARM, A_CORE_MASK, 1},
 #endif
 #ifdef SUPPORT_CAT1_MODEM
     {TOPIC_EVENT_CAT1_INCOMMING, A_CORE_MASK, 1},
index 5682646..e815168 100755 (executable)
@@ -53,6 +53,7 @@ const PriorityMapper g_pri_mapper[] = {
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     {TOPIC_EVENT_CHARGE_PLUG, PRIORITY_TWO},
     {TOPIC_EVENT_CHARGE_UNPLUG, PRIORITY_TWO},
+    {TOPIC_EVENT_LOWPOWER_ALARM,PRIORITY_TWO},
 #endif
     {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE},
     {TOPIC_EVENT_HFP_FINISHED, PRIORITY_ONE},
@@ -60,6 +61,7 @@ const PriorityMapper g_pri_mapper[] = {
     {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE},
     {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE},
     {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE},
+
 #ifdef SUPPORT_CAT1_MODEM
     {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE},
     {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE},
@@ -118,6 +120,7 @@ void MsgCenterSubscribe()
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_PLUG);
     MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_UNPLUG);
+    MsgCenterSubscribeTopic(TOPIC_EVENT_LOWPOWER_ALARM);
 #endif
 #ifdef SUPPORT_SPO2_NOTIFICATION_TEST
     MsgCenterSubscribeTopic(TOPIC_EVENT_SPO2_UPDATE);
@@ -244,6 +247,23 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req)
         t->ChangeViewcolor(false);
     }
 }
+
+void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req)
+{
+    unused(req);
+    unused(topic);
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !");
+    //TODO: 亮屏弹窗倒计时5秒关机(不需要取消,强制关机)
+    // DialModelCharge::GetInstance()->UpdateChargeStuaut(0);
+    // SaveEleModel::GetInstance()->SetChargeStuaut(0);
+    
+    // testCHANINGView *t=testCHANINGView::GetInstance();
+    // if(t!=NULL)
+    // {
+        // t->ChangeViewcolor(false);
+    // }
+}
+
 #endif
 void MsgCenterNotifyNextDayProc(const Topic topic, Request* req)
 {
@@ -699,6 +719,7 @@ static msg_center_notify_table_t g_msg_center_notify_table[] = {
 #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION
     {TOPIC_EVENT_CHARGE_PLUG,        MsgCenterNotifyChargePlugProc},
     {TOPIC_EVENT_CHARGE_UNPLUG,      MsgCenterNotifyChargeUnPlugProc},
+    {TOPIC_EVENT_LOWPOWER_ALARM,      MsgCenterNotifyLowPowerAlarmProc},
 #endif
 #ifdef SUPPORT_SPO2_NOTIFICATION_TEST
     {TOPIC_EVENT_SPO2_UPDATE,           MsgCenterNotifySPO2hProc},