修复屏幕常亮函数无效问题 21/1 21/head 22/target/1
authorSnickerSun <snickersun@163.com>
Wed, 17 Apr 2024 01:24:03 +0000 (09:24 +0800)
committerSnickerSun <snickersun@163.com>
Wed, 17 Apr 2024 01:24:03 +0000 (09:24 +0800)
添加Calander,关机记录时间。

code/sdk/application/wearable/service/power_manager/src/power_display_service.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 5db3374..8eb1721 100755 (executable)
@@ -131,7 +131,9 @@ static errcode_t power_display_set_auto_timeout_function(bool enable)
 
 static errcode_t power_display_set_keepon_timeout(uint32_t time)
 {
-    if (g_screen_context.keep_on_timeout != 0 && time != 0) {
+    // if (g_screen_context.keep_on_timeout != 0 && time != 0) 
+    if (g_screen_context.keep_on_timeout != 0 ) 
+    {
         POWER_DISPLAY_PRINT_ERR(0, "current has been set %u,need to wait for timeout or set 0 to cancel. \r\n",
             g_screen_context.keep_on_timeout);
         return ERRCODE_FAIL;
index e625e4b..cce9b22 100644 (file)
@@ -22,6 +22,7 @@
 #include "pinctrl.h"
 #include "errcode.h"
 #include "power_display_service.h"
+#include "config/include/ConfigModelC.h"
 
 #define SUPPORT_NV
 
@@ -151,10 +152,60 @@ bool is_doing_shutdown_or_reboot(void)
     return doing_shutdown_or_reboot;
 }
 
+bool start_custom_ble_service(void)
+{
+#ifdef SUPPORT_BLE_SERVICE
+        // openBle();
+        PRINT("start custom protocol classic bt ble service !\r\n");
+        bool ret = enable_bt_stack();
+#endif 
+    return true;
+}
+bool stop_custom_ble_service(void)
+{
+#ifdef SUPPORT_BLE_SERVICE
+        PRINT("start custom protocol classic bt ble service !\r\n");
+        // ble_unregist_server();
+        // closeBle();
+        bool ret = disable_bt_stack();
+#endif 
+    return true;
+}
+
+bool start_alipay_ble_service(void)
+{
+    if(get_ble_status())
+    {
+        PRINT("stop custom protocol classic bt ble service first !\r\n");
+        stop_custom_ble_service();
+        uapi_systick_delay_ms(20);
+    }
+    PRINT("start_alipay_ble_service !\r\n");
+    svr_alipay_bluetooth_init();
+    return true;
+}
+bool stop_alipay_ble_service(void)
+{
+    
+    PRINT("stop_alipay_ble_service !\r\n");
+    alipay_unregist_server();
+    disable_bt_stack();
+    if(custom_ble_service_on_flag())
+    {
+        PRINT("start_custom_ble_service !\r\n");
+        uapi_systick_delay_ms(20);
+        start_custom_ble_service();
+    }
+    return true;
+}
 void startup_post_init_task(void)
 {
 
     PRINT("startup_post_init_task !\r\n");
+    if(custom_ble_service_on_flag())
+    {
+        start_custom_ble_service();
+    }
 
     LOS_Msleep(5000);
     if ( poweron_cat1_on_bootup_flag() )
@@ -484,6 +535,7 @@ void ScreenAlwaysOnCtr(uint8_t turnOnFlag)
     if(turnOnFlag)
     {
         const power_display_svr_api_t *display_api = power_display_svr_get_api();
+        display_api->set_screen_set_keepon_timeout(0);
         if (display_api->get_screen_state() != SCREEN_ON)
         {
             display_api->turn_on_screen();
@@ -519,15 +571,15 @@ int32_t uapi_get_screen_state(void)
 
 
 
-extern void wstp_spp_cmd_server_create(const char *spp_uuid, const char *name, uint8_t name_len);
-extern void wstp_spp_cmd_server_accept(uint32_t server_id);
-extern errcode_t enable_bt_stack(void);
-extern errcode_t disable_bt_stack(void);
-extern errcode_t enable_ble(void);
-extern errcode_t bluetooth_set_local_addr(unsigned char *mac, unsigned int len);
-extern errcode_t bluetooth_get_local_addr(unsigned char *mac, unsigned int len);
-extern errcode_t bluetooth_set_local_name(const unsigned char *localName, unsigned char length);
-extern errcode_t bluetooth_get_local_name(unsigned char *localName, unsigned char *length);
+// extern void wstp_spp_cmd_server_create(const char *spp_uuid, const char *name, uint8_t name_len);
+// extern void wstp_spp_cmd_server_accept(uint32_t server_id);
+// extern errcode_t enable_bt_stack(void);
+// extern errcode_t disable_bt_stack(void);
+// extern errcode_t enable_ble(void);
+// extern errcode_t bluetooth_set_local_addr(unsigned char *mac, unsigned int len);
+// extern errcode_t bluetooth_get_local_addr(unsigned char *mac, unsigned int len);
+// extern errcode_t bluetooth_set_local_name(const unsigned char *localName, unsigned char length);
+// extern errcode_t bluetooth_get_local_name(unsigned char *localName, unsigned char *length);
 errcode_t uapi_get_btname(uint8_t *buf_btname, uint32_t *len_btname)
 {
     if(buf_btname == NULL || len_btname == NULL)
index 3cf6b2d..9de742c 100644 (file)
@@ -111,6 +111,19 @@ void get_gsensor_single(uint8_t *databuf);
 void shutdown_reboot_prejobs(void);
 void start_shutdown_or_reboot(void);
 bool is_doing_shutdown_or_reboot(void);
+
+
+
+bool start_custom_ble_service(void);
+bool stop_custom_ble_service(void);
+
+bool start_alipay_ble_service(void);
+bool stop_alipay_ble_service(void);
+
+
+uint32_t uapi_calendar_recover_date(void);
+uint32_t uapi_calendar_store_date(void);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */