Преглед на файлове

1、加入蓝牙连接功能(上电默认开了蓝牙,已关闭一些启动的代码,但没有完全关闭,还需修改;连接新手机的功能待修改完善;连接上蓝牙设备后的提示语待修改完善)
2、调整控制中心配置表aem_quick_setting_prio_e,关闭低点模式和气压计模式额支持
3、保留系统设置功能(里面的部分功能待删除)

mohliy преди 3 месеца
родител
ревизия
87f0f11e84
променени са 27 файла, в които са добавени 597 реда и са изтрити 151 реда
  1. BIN
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.enG
  2. BIN
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res
  3. BIN
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty
  4. BIN
      application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.zhC
  5. 19 2
      application/aem_watch/resource/360x360/bt_watch.ui
  6. 1 1
      application/aem_watch/resource/360x360/bt_watch_enG.c
  7. 3 1
      application/aem_watch/resource/360x360/bt_watch_sty.h
  8. 2 2
      application/aem_watch/resource/360x360/bt_watch_zhC.c
  9. 1 0
      application/aem_watch/resource/360x360/res_include.h
  10. 112 112
      application/aem_watch/resource/360x360/res_style_bitmap.c
  11. BIN
      application/aem_watch/resource/360x360/settings/Bluetooth/蓝牙.png
  12. BIN
      application/aem_watch/resource/360x360/settings/Bluetooth/连接新手机.png
  13. BIN
      application/aem_watch/resource/multiLang_translate_table.xls
  14. 8 0
      application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj
  15. 27 0
      application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj.filters
  16. 11 0
      application/aem_watch/simulator/LVGL.Simulator/bt_watch_simulator.c
  17. 1 0
      application/aem_watch/src/application/quick_settings/CMakeLists.txt
  18. 1 1
      application/aem_watch/src/application/quick_settings/aem_quick_setting_alarm.c
  19. 5 5
      application/aem_watch/src/application/quick_settings/aem_quick_setting_app_settings.c
  20. 69 0
      application/aem_watch/src/application/quick_settings/aem_quick_setting_bluetooth_setting.c
  21. 1 0
      application/aem_watch/src/application/settings/CMakeLists.txt
  22. 65 7
      application/aem_watch/src/application/settings/aem_bluetooth.c
  23. 249 0
      application/aem_watch/src/application/settings/aem_bt_connect_more.c
  24. 13 12
      application/aem_watch/src/user_cfg/data_default_cfg.h
  25. 4 4
      framework/bluetooth/bt_manager/bt_manager.c
  26. 4 4
      framework/bluetooth/bt_manager/bt_manager_connect.c
  27. 1 0
      thirdparty/lib/aem/include/aem_activity_id.h

BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.enG


BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res


BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty


BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.zhC


+ 19 - 2
application/aem_watch/resource/360x360/bt_watch.ui

@@ -5315,8 +5315,8 @@
                     <property name="id" value="31565" />
                     <property name="x" value="0x0000" />
                     <property name="y" value="0x0000" />
-                    <property name="width" value="0x003e" />
-                    <property name="height" value="0x003e" />
+                    <property name="width" value="0x003c" />
+                    <property name="height" value="0x003c" />
                     <property name="visible" value="0x0011" />
                     <property name="compress" value="0x0000" />
                     <property name="PNG_A8" value="0x0000" />
@@ -5325,6 +5325,21 @@
                         <property name="0" value=".\settings\bluetooth\蓝牙.png" />
                     </element>
                 </element>
+                <element class="picture_resource">
+                    <property name="name" value="Pic_connect_more" />
+                    <property name="id" value="33285" />
+                    <property name="x" value="0x0000" />
+                    <property name="y" value="0x0000" />
+                    <property name="width" value="0x003c" />
+                    <property name="height" value="0x003c" />
+                    <property name="visible" value="0x0011" />
+                    <property name="compress" value="0x0000" />
+                    <property name="PNG_A8" value="0x0000" />
+                    <property name="ARGB" value="0x0000" />
+                    <element class="layer">
+                        <property name="0" value=".\settings\bluetooth\连接新手机.png" />
+                    </element>
+                </element>
                 <element class="string_resource">
                     <property name="name" value="str_bt_connect" />
                     <property name="id" value="31750" />
@@ -22451,7 +22466,9 @@
         <picture value=".\quick_settings\蓝牙连接.png" />
         <picture value=".\quick_settings\连接.png" />
         <picture value=".\logo\app_logo.png" />
+        <picture value=".\settings\bluetooth\连接新手机.png" />
         <txt value="..\multilang_translate_table.xls" />
+        <txt value="..\multiLang_translate_table.xls" />
         <string value="key_setupwizard_language" />
         <string value="key_setupwizard_download_app" />
         <string value="key_setupwizard_scan_download" />

+ 1 - 1
application/aem_watch/resource/360x360/bt_watch_enG.c

@@ -416,7 +416,7 @@ static const uint8_t STR_207[] = {0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69
 
 static const uint8_t STR_208[] = {0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x0}; 
 
-static const uint8_t STR_209[] = {0x42, 0x54, 0x20, 0x68, 0x65, 0x61, 0x64, 0x73, 0x65, 0x74, 0x0}; 
+static const uint8_t STR_209[] = {0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x0}; 
 
 static const uint8_t STR_210[] = {0x4e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x0}; 
 

+ 3 - 1
application/aem_watch/resource/360x360/bt_watch_sty.h

@@ -262,6 +262,7 @@
 #define  STR_CASCADE_ZOOM    0xd9217588
 #define  RES_BLUETOOTH    0x65f7c071
 #define  PIC_EARPHONE    0x81d6ebab
+#define  PIC_CONNECT_MORE    0x724bff49
 #define  STR_BT_HEADSET    0x815c557d
 #define  STR_BT_PHONE_TIP    0xcb5491c1
 #define  STR_BT_SCANNING    0xe33d1b04
@@ -320,7 +321,6 @@
 #define  RES_SYSTEM    0xa842908e
 #define  PIC_POWER_OFF    0x1f9b3878
 #define  PIC_RESET    0xd4d23250
-#define  PIC_CONNECT_MORE    0x724bff49
 #define  PIC_RESTART    0xa6c4bdb4
 #define  STR_CONNECT_MORE    0x9ed7243a
 #define  STR_CONNECT_MORE_TIPS    0xf74114bf
@@ -1078,6 +1078,8 @@
 #define  STATISTIC_SLEEP_TIPS    0x7d377963
 #define  SCENE_SHOW_LOGO    0x3a2de11a
 #define  PIC_APP_LOGO    0xf52a384a
+#define  STR_BT_CONNECT_MORE    0xad6733b
+#define  STR_BT_BLUETOOTH    0x2c134409
 #define  SCENE_RECORDER    0x348a22e9
 #define  PIC_LIST_ICON    0x4c38689d
 #define  PIC_LISTS_ICON    0xa75119ae

+ 2 - 2
application/aem_watch/resource/360x360/bt_watch_zhC.c

@@ -416,7 +416,7 @@ static const uint8_t STR_207[] = {0xe6, 0xad, 0xa3, 0xe5, 0x9c, 0xa8, 0xe8, 0xbf
 
 static const uint8_t STR_208[] = {0xe6, 0x96, 0xad, 0xe5, 0xbc, 0x80, 0x0}; 
 
-static const uint8_t STR_209[] = {0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0xe8, 0x80, 0xb3, 0xe6, 0x9c, 0xba, 0x0}; 
+static const uint8_t STR_209[] = {0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0x0}; 
 
 static const uint8_t STR_210[] = {0xe6, 0x9c, 0xaa, 0xe8, 0xbf, 0x9e, 0xe6, 0x8e, 0xa5, 0x0}; 
 
@@ -424,7 +424,7 @@ static const uint8_t STR_211[] = {0xe5, 0x8f, 0xaf, 0xe9, 0x85, 0x8d, 0xe5, 0xaf
 
 static const uint8_t STR_212[] = {0xe5, 0x9b, 0xa0, 0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0xe9, 0x99, 0x90, 0xe5, 0x88, 0xb6, 0xef, 0xbc, 0x8c, 0xe8, 0xbf, 0x9e, 0xe6, 0x8e, 0xa5, 0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0xe8, 0x80, 0xb3, 0xe6, 0x9c, 0xba, 0xe5, 0x90, 0x8e, 0xef, 0xbc, 0x8c, 0xe6, 0x89, 0x8b, 0xe6, 0x9c, 0xba, 0xe6, 0x9d, 0xa5, 0xe7, 0x94, 0xb5, 0xe5, 0xb0, 0x86, 0xe6, 0x97, 0xa0, 0xe6, 0xb3, 0x95, 0xe5, 0x90, 0x8c, 0xe6, 0xad, 0xa5, 0xe5, 0x88, 0xb0, 0xe6, 0x89, 0x8b, 0xe8, 0xa1, 0xa8, 0xe3, 0x80, 0x82, 0x0}; 
 
-static const uint8_t STR_213[] = {0xe6, 0xad, 0xa3, 0xe5, 0x9c, 0xa8, 0xe6, 0x90, 0x9c, 0xe7, 0xb4, 0xa2, 0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0xe8, 0x80, 0xb3, 0xe6, 0x9c, 0xba, 0x2e, 0x2e, 0x2e, 0x0}; 
+static const uint8_t STR_213[] = {0xe6, 0xad, 0xa3, 0xe5, 0x9c, 0xa8, 0xe6, 0x90, 0x9c, 0xe7, 0xb4, 0xa2, 0xe8, 0x93, 0x9d, 0xe7, 0x89, 0x99, 0xe8, 0xae, 0xbe, 0xe5, 0xa4, 0x87, 0x2e, 0x2e, 0x2e, 0x0}; 
 
 static const uint8_t STR_214[] = {0xe5, 0x8f, 0x96, 0xe6, 0xb6, 0x88, 0xe9, 0x85, 0x8d, 0xe5, 0xaf, 0xb9, 0x0}; 
 

+ 1 - 0
application/aem_watch/resource/360x360/res_include.h

@@ -139,6 +139,7 @@ extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_SET_WATCHFACE_PIC_WATCHFACE;
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_SET_WATCHFACE_PIC_AOD; 
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_BLUETOOTH_PIC_EARPHONE; 
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_BLUETOOTH_PIC_BLUETOOTH; 
+extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_BLUETOOTH_PIC_CONNECT_MORE; 
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_SOUND_VIBRATION_PIC_MEDIA; 
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_SOUND_VIBRATION_PIC_MIN_VIBRATE; 
 extern lv_img_dsc_t IMG_SCENE_SETTINGS_RES_SOUND_VIBRATION_PIC_MAX_VIBRATE; 

Файловите разлики са ограничени, защото са твърде много
+ 112 - 112
application/aem_watch/resource/360x360/res_style_bitmap.c


BIN
application/aem_watch/resource/360x360/settings/Bluetooth/蓝牙.png


BIN
application/aem_watch/resource/360x360/settings/Bluetooth/连接新手机.png


BIN
application/aem_watch/resource/multiLang_translate_table.xls


+ 8 - 0
application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj

@@ -67,6 +67,12 @@
     <ClInclude Include="..\..\..\..\framework\base\property\property_inner.h" />
     <ClInclude Include="..\..\..\..\framework\base\utils\misc\trace.h" />
     <ClInclude Include="..\..\..\..\framework\base\utils\stream\stream_internal.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btdrv_api.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_api.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_base.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_tws_api.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\bt_manager.h" />
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\bt_manager_ble.h" />
     <ClInclude Include="..\..\..\..\framework\display\compression\lz4\lz4.h" />
     <ClInclude Include="..\..\..\..\framework\display\compression\lz4\lz4hc.h" />
     <ClInclude Include="..\..\..\..\framework\display\compression\rle\rle.h" />
@@ -446,6 +452,7 @@
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting.c" />
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_alarm.c" />
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_app_settings.c" />
+    <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_bluetooth_setting.c" />
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_brightness.c" />
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_display_off.c" />
     <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_dnd.c" />
@@ -465,6 +472,7 @@
     <ClCompile Include="..\..\src\application\settings\aem_app_view.c" />
     <ClCompile Include="..\..\src\application\settings\aem_battery_manager.c" />
     <ClCompile Include="..\..\src\application\settings\aem_bluetooth.c" />
+    <ClCompile Include="..\..\src\application\settings\aem_bt_connect_more.c" />
     <ClCompile Include="..\..\src\application\settings\aem_bt_operate.c" />
     <ClCompile Include="..\..\src\application\settings\aem_display.c" />
     <ClCompile Include="..\..\src\application\settings\aem_not_disturb.c" />

+ 27 - 0
application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj.filters

@@ -707,6 +707,24 @@
     <ClInclude Include="..\..\src\application\show_logo\aem_show_logo.h">
       <Filter>aem_watch\application\show_logo</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\bt_manager.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\bt_manager_ble.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btdrv_api.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_api.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_base.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\framework\bluetooth\include\btservice_tws_api.h">
+      <Filter>framework\bluetooth\include</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Manifest Include="LVGL.Simulator.manifest" />
@@ -1559,6 +1577,12 @@
     <ClCompile Include="..\..\src\application\show_logo\aem_show_logo.c">
       <Filter>aem_watch\application\show_logo</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\application\quick_settings\aem_quick_setting_bluetooth_setting.c">
+      <Filter>aem_watch\application\quick_setting</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\application\settings\aem_bt_connect_more.c">
+      <Filter>aem_watch\application\settings</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="LVGL.Simulator.rc" />
@@ -1958,6 +1982,9 @@
     <Filter Include="aem_watch\application\show_logo">
       <UniqueIdentifier>{0eaf7f74-3ac1-4da6-9044-9da889e162b1}</UniqueIdentifier>
     </Filter>
+    <Filter Include="framework\bluetooth\include">
+      <UniqueIdentifier>{5d8e3c99-71be-40cb-99e7-baf7f3f4e364}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <Library Include="..\lib\aem_gui_fwk.lib" />

+ 11 - 0
application/aem_watch/simulator/LVGL.Simulator/bt_watch_simulator.c

@@ -301,6 +301,7 @@ extern int aem_aod_watchface_create(void *user_data);
 extern int aem_sliding_effect_create(void *user_data);
 extern int aem_bluetooth_create(void *user_data);
 extern int aem_bt_operate_create(void *user_data);
+extern int aem_bt_connect_more_create(void *user_data);
 extern int aem_sound_vibration_create(void *user_data);
 extern int aem_display_create(void *user_data);
 extern int aem_screen_time_create(void *user_data);
@@ -426,6 +427,10 @@ aem_act_list_desc_t aem_app_activity_begin[] =
             .act_id = AEM_SET_BT_OPERATE,
             .activity_entry = aem_bt_operate_create,
         },
+        {
+            .act_id = AEM_SET_BT_CONNECT_MORE,
+            .activity_entry = aem_bt_connect_more_create,
+        },
         {
             .act_id = AEM_SET_SOUND_VIBRATION,
             .activity_entry = aem_sound_vibration_create,
@@ -633,6 +638,7 @@ aem_launch_desc_t aem_launch_db_begin[] =
 aem_launch_desc_t *aem_launch_db_end = NULL;
 
 extern const aem_quick_setting_ops_t quick_setting_app_settings_ops;
+extern const aem_quick_setting_ops_t quick_setting_app_bluetooth_setting_ops;
 extern const aem_quick_setting_ops_t quick_setting_display_off_ops;
 #if 0
 extern const aem_quick_setting_ops_t quick_setting_mute_mode_ops;
@@ -655,6 +661,11 @@ aem_quick_setting_desc_t aem_quick_setting_db_begin[] =
             .op = &quick_setting_app_settings_ops,
         },
 
+        {
+            .priority = AEM_QUICK_SETTING_BLUETOOTH_SETTING,
+            .op = &quick_setting_app_bluetooth_setting_ops,
+        },
+
 #if CONFIG_AEM_APPLICATION_LOCAL_MUSIC
         {
             .priority = AEM_QUICK_SETTING_PHONE_MODE,

+ 1 - 0
application/aem_watch/src/application/quick_settings/CMakeLists.txt

@@ -9,6 +9,7 @@ add_subdirectory(scr_lock)
 zephyr_library_sources(aem_quick_setting.c)
 zephyr_library_sources(aem_quick_setting_alarm.c)
 zephyr_library_sources(aem_quick_setting_app_settings.c)
+zephyr_library_sources(aem_quick_setting_bluetooth_setting.c)
 zephyr_library_sources(aem_quick_setting_brightness.c)
 zephyr_library_sources(aem_quick_setting_dnd.c)
 zephyr_library_sources(aem_quick_setting_drain.c)

+ 1 - 1
application/aem_watch/src/application/quick_settings/aem_quick_setting_alarm.c

@@ -47,7 +47,7 @@ void alarm_btn_create(lv_obj_t *card_bg)
     lv_memset(s_ui, 0, sizeof(alarm_ui_t));
 
     s_ui->btn = aem_waterfall_btn_create(card_bg, QUICK_SETTING_CARD_SIZE, QUICK_SETTING_CARD_SIZE, get_img[0]);
-    lv_obj_align(s_ui->btn, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(0), 0);
+    lv_obj_align(s_ui->btn, LV_ALIGN_CENTER, AEM_SIZE_HOR_FACTOR_466(0), 0);
     lv_obj_add_event_cb(s_ui->btn, card_event_cb, LV_EVENT_ALL, NULL);
 }
 

+ 5 - 5
application/aem_watch/src/application/quick_settings/aem_quick_setting_app_settings.c

@@ -11,9 +11,10 @@ typedef struct
 } app_settings_ui_t;
 static app_settings_ui_t *s_ui = NULL;
 
-static lv_img_dsc_t *get_img[1] =
-{
-    &IMG_SCENE_QUICK_SETTINGS_PIC_BLUETOOTH_SETTING,
+static lv_img_dsc_t *get_img[2] =
+    {
+        &IMG_SCENE_QUICK_SETTINGS_PIC_SETTING,
+        &IMG_SCENE_QUICK_SETTINGS_PIC_SETTINGS,
 };
 
 static void card_event_cb(lv_event_t *e)
@@ -23,7 +24,7 @@ static void card_event_cb(lv_event_t *e)
 
     if (LV_EVENT_PRESSED == e->code)
     {
-        simple_img_set_src(s_ui->btn, get_img[0]);
+        simple_img_set_src(s_ui->btn, get_img[1]);
     }
     else if (LV_EVENT_RELEASED == e->code)
     {
@@ -48,7 +49,6 @@ static void app_settings_btn_create(lv_obj_t *card_bg)
     lv_memset(s_ui, 0, sizeof(app_settings_ui_t));
 
     s_ui->btn = aem_waterfall_btn_create(card_bg, QUICK_SETTING_CARD_SIZE, QUICK_SETTING_CARD_SIZE, get_img[0]);
-    lv_obj_align(s_ui->btn, LV_ALIGN_CENTER, AEM_SIZE_HOR_FACTOR_466(0), 0);
     lv_obj_add_event_cb(s_ui->btn, card_event_cb, LV_EVENT_ALL, NULL);
 }
 

+ 69 - 0
application/aem_watch/src/application/quick_settings/aem_quick_setting_bluetooth_setting.c

@@ -0,0 +1,69 @@
+#include "aem_quick_setting_fwk.h"
+#include "data_default_cfg.h"
+#include "aem_quick_setting.h"
+// #include "quick_setting_service.h"
+#include "aem_app_fwk.h"
+#include "simple_img.h"
+
+typedef struct
+{
+    lv_obj_t *btn;
+} app_bluetooth_setting_ui_t;
+static app_bluetooth_setting_ui_t *s_ui = NULL;
+
+static lv_img_dsc_t *get_img[1] =
+{
+    &IMG_SCENE_QUICK_SETTINGS_PIC_BLUETOOTH_SETTING,
+};
+
+static void card_event_cb(lv_event_t *e)
+{
+    if (s_ui == NULL)
+        return;
+
+    if (LV_EVENT_CLICKED == e->code)
+    {
+        //aem_app_run(AEM_APP_ID_SETTINGS);
+        aem_activity_run(AEM_SET_BLUETOOTH, NULL);
+    }
+}
+
+static void app_bluetooth_setting_btn_create(lv_obj_t *card_bg)
+{
+    if (s_ui)
+        return;
+
+    s_ui = (app_bluetooth_setting_ui_t *)lv_mem_alloc(sizeof(app_bluetooth_setting_ui_t));
+
+    if (s_ui == NULL)
+        return;
+
+    lv_memset(s_ui, 0, sizeof(app_bluetooth_setting_ui_t));
+
+    s_ui->btn = aem_waterfall_btn_create(card_bg, QUICK_SETTING_CARD_SIZE, QUICK_SETTING_CARD_SIZE, get_img[0]);
+    lv_obj_align(s_ui->btn, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(0), 0);
+    lv_obj_add_event_cb(s_ui->btn, card_event_cb, LV_EVENT_ALL, NULL);
+}
+
+static void app_bluetooth_setting_btn_destroy(void)
+{
+    if (s_ui != NULL)
+    {
+        if (s_ui->btn != NULL)
+        {
+            lv_obj_del(s_ui->btn);
+            s_ui->btn = NULL;
+        }
+
+        lv_mem_free(s_ui);
+        s_ui = NULL;
+    }
+}
+
+const aem_quick_setting_ops_t quick_setting_app_bluetooth_setting_ops = {
+    .create = app_bluetooth_setting_btn_create,
+    .destroy = app_bluetooth_setting_btn_destroy,
+    .refresh = NULL,
+};
+
+AEM_QUICK_SETTING_REGISTER(AEM_QUICK_SETTING_BLUETOOTH_SETTING, (aem_quick_setting_ops_t *)&quick_setting_app_bluetooth_setting_ops);

+ 1 - 0
application/aem_watch/src/application/settings/CMakeLists.txt

@@ -11,6 +11,7 @@ zephyr_library_sources(aem_aod_display.c)
 zephyr_library_sources(aem_aod_watchface_set.c)
 zephyr_library_sources(aem_bluetooth.c)
 zephyr_library_sources(aem_bt_operate.c)
+zephyr_library_sources(aem_bt_connect_more.c)
 zephyr_library_sources(aem_sound_vibration.c)
 zephyr_library_sources(aem_display.c)
 zephyr_library_sources(aem_screen_time.c)

+ 65 - 7
application/aem_watch/src/application/settings/aem_bluetooth.c

@@ -7,7 +7,11 @@
 
 #include "aem_settings.h"
 #include "aem_music_service.h"
-
+#include "aem_settings_zoom_item.h"
+#ifndef CONFIG_SIMULATOR
+#include "bt_manager_ble.h"
+#include "bt_manager.h"
+#endif
 #include "aem_sys.h"
 #include "text_canvas.h"
 
@@ -18,6 +22,7 @@ typedef struct
     lv_obj_t *page;
     lv_obj_t *bt;
     lv_obj_t *bt_switch;
+    lv_obj_t *bt_connect_more;
     lv_obj_t *list;
     lv_obj_t *sub_label;
     aem_bt_device_info_t *info;
@@ -38,7 +43,7 @@ static void aem_bluetooth_updata(void)
 
     s_ui->sw = !s_ui->sw;
     aem_share_set_bt_earphone(s_ui->sw);
-    lv_obj_scroll_to_y(s_ui->page, 0, LV_ANIM_OFF);
+    lv_obj_scroll_to_y(s_ui->page, 0, LV_ANIM_OFF); 
 }
 
 static void connect_timer(lv_timer_t *t)
@@ -118,7 +123,7 @@ static void item_event_handler(lv_event_t *event)
         AEM_LOG_I("s_ui->timer %p", s_ui->timer);
     }
 }
-
+#if 0
 static void update_ui(aem_bt_device_info_t *info)
 {
     if (s_ui == NULL || info == NULL)
@@ -153,7 +158,7 @@ static void update_ui(aem_bt_device_info_t *info)
         lv_obj_add_event_cb(item, item_event_handler, LV_EVENT_SHORT_CLICKED, NULL);
     }
 }
-
+#endif
 static void refresh_list(aem_msg_t *msg)
 {
     if (UI_BT_EARPHONE_REFRESH != msg->sub_type)
@@ -209,10 +214,29 @@ static void refresh_list(aem_msg_t *msg)
     }
     lv_obj_clean(s_ui->list);
 
-    for (size_t i = 0; i < cnt; i++)
+    res_string_id_e str_id = ID_KEY_SETTINGS_BT_SCANNING;
+
+#ifndef CONFIG_SIMULATOR
+    if (bt_manager_get_ble_state() == BT_STATUS_BLE_CONNECTED)
+#endif    
     {
-        update_ui(&s_ui->info[i]);
+        str_id = ID_KEY_SETTINGS_BT_CONNECTED;
+    }
+    
+    lv_obj_t *tips = text_canvas_create(s_ui->list);
+    if (tips)
+    {
+        lv_obj_set_style_text_align(tips, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
+        lv_obj_set_style_text_color(tips, lv_color_white(), LV_PART_MAIN);
+        lv_obj_set_style_text_opa(tips, LV_OPA_50, LV_PART_MAIN);
+        lv_obj_set_style_text_font(tips, aem_font_sub(), LV_PART_MAIN);
+        lv_obj_set_style_pad_top(tips, 28, LV_PART_MAIN);
+        text_canvas_set_text(tips, res_manager_get_string_from_id(str_id));
     }
+    //for (size_t i = 0; i < cnt; i++)
+    //{
+    //    update_ui(&s_ui->info[i]);
+    //}
 }
 
 static void refresh_item(aem_msg_t *msg)
@@ -271,7 +295,7 @@ static void set_item_hidden(bool status)
                     text_canvas_set_text(tips, res_manager_get_string_from_id(ID_KEY_SETTINGS_BT_SCANNING));
                 }
             }
-#ifdef CONFIG_SIMULATOR
+#if 0//def CONFIG_SIMULATOR
             if (s_ui->info != NULL)
             {
                 lv_mem_free(s_ui->info);
@@ -290,6 +314,22 @@ static void set_item_hidden(bool status)
                     update_ui(&s_ui->info[i]);
                 }
             }
+#endif // CONFIG_SIMULATOR
+#ifdef CONFIG_SIMULATOR
+            res_string_id_e str_id = ID_KEY_SETTINGS_BT_SCANNING;
+
+            str_id = ID_KEY_SETTINGS_BT_CONNECTED;
+    
+            lv_obj_t *tips = text_canvas_create(s_ui->list);
+            if (tips)
+            {
+                lv_obj_set_style_text_align(tips, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
+                lv_obj_set_style_text_color(tips, lv_color_white(), LV_PART_MAIN);
+                lv_obj_set_style_text_opa(tips, LV_OPA_50, LV_PART_MAIN);
+                lv_obj_set_style_text_font(tips, aem_font_sub(), LV_PART_MAIN);
+                lv_obj_set_style_pad_top(tips, 28, LV_PART_MAIN);
+                text_canvas_set_text(tips, res_manager_get_string_from_id(str_id));
+            }
 #endif // CONFIG_SIMULATOR
         }
     }
@@ -323,6 +363,16 @@ static void switch_event_handler(lv_event_t *event)
     aem_bluetooth_updata();
     set_item_hidden(s_ui->sw);
     s_ui->connect_time = 0xFF;
+
+    aem_os_settings_data_write();  //保存设置
+}
+
+static void connect_more_event_handler(lv_event_t *event)
+{
+    if (s_ui == NULL)
+        return;
+
+    aem_activity_run(AEM_SET_BT_CONNECT_MORE, NULL);
 }
 
 static void create_ui(void)
@@ -358,6 +408,14 @@ static void create_ui(void)
                 lv_obj_clear_flag(s_ui->bt_switch, LV_OBJ_FLAG_CLICKABLE);
             }
         }
+
+        s_ui->bt_connect_more = aem_settings_zoom_item_create(s_ui->page);
+        if (s_ui->bt_connect_more)
+        {
+            aem_settings_zoom_item_set_src(s_ui->bt_connect_more, &IMG_SCENE_SETTINGS_RES_BLUETOOTH_PIC_CONNECT_MORE);
+            aem_settings_zoom_item_set_text(s_ui->bt_connect_more, res_manager_get_string_from_id(ID_KEY_SETTINGS_SYSTEM_CONNECT_TO));
+            aem_settings_zoom_item_click_cb(s_ui->bt_connect_more, connect_more_event_handler, NULL);
+        }
     }
 
     s_ui->sw = false;

+ 249 - 0
application/aem_watch/src/application/settings/aem_bt_connect_more.c

@@ -0,0 +1,249 @@
+/**
+ * @FileName     : aem_bt_connect_more.c
+ * @Author       : wingcool_group
+ * @CreateDate   : 2024/12/05 20:34:03
+ * @Description  : bt connect to other device
+ **/
+
+#include "aem_settings.h"
+#include "text_canvas.h"
+#include "aem_img_btn.h"
+#include "aem_app_comm.h"
+#include "aem_power.h"
+
+#define ACTIVITY_ID         "bt_connect_more"
+#define LOADING_IMG_CNT     (24)
+
+typedef struct
+{
+    lv_obj_t *bg;
+    lv_obj_t *ok;
+    lv_obj_t *cancel;
+    lv_obj_t *anim;
+} bt_connect_more_ui_t;
+
+static bt_connect_more_ui_t *s_ui = NULL;
+static aem_system_type_e type = 0;
+static uint16_t tipe_w = 420;
+static uint16_t tipe_h = 200;
+const uint16_t bt_connect_more_pad_top = 46;
+const uint8_t bt_connect_more_btn_x = 100;
+const int8_t bt_connect_more_btn_y = -40;
+
+static const void* loading_img[LOADING_IMG_CNT] =
+{
+    &IMG_SCENE_WIDGET_PIC_0,
+    &IMG_SCENE_WIDGET_PIC_1,
+    &IMG_SCENE_WIDGET_PIC_2,
+    &IMG_SCENE_WIDGET_PIC_3,
+    &IMG_SCENE_WIDGET_PIC_4,
+    &IMG_SCENE_WIDGET_PIC_5,
+    &IMG_SCENE_WIDGET_PIC_6,
+    &IMG_SCENE_WIDGET_PIC_7,
+    &IMG_SCENE_WIDGET_PIC_8,
+    &IMG_SCENE_WIDGET_PIC_9,
+    &IMG_SCENE_WIDGET_PIC_10,
+    &IMG_SCENE_WIDGET_PIC_11,
+    &IMG_SCENE_WIDGET_PIC_12,
+    &IMG_SCENE_WIDGET_PIC_13,
+    &IMG_SCENE_WIDGET_PIC_14,
+    &IMG_SCENE_WIDGET_PIC_15,
+    &IMG_SCENE_WIDGET_PIC_16,
+    &IMG_SCENE_WIDGET_PIC_17,
+    &IMG_SCENE_WIDGET_PIC_18,
+    &IMG_SCENE_WIDGET_PIC_19,
+    &IMG_SCENE_WIDGET_PIC_20,
+    &IMG_SCENE_WIDGET_PIC_21,
+    &IMG_SCENE_WIDGET_PIC_22,
+    &IMG_SCENE_WIDGET_PIC_23,
+};
+
+static void btn_click_cb(lv_obj_t *btn)
+{
+    if (btn == s_ui->cancel)
+    {
+        aem_app_goback();
+    }
+    else if (btn == s_ui->ok)
+    {
+        aem_power_onoff_t on_off = { 0 };
+        switch (type)
+        {
+        case AEM_CONNECT_MORE:
+        {
+            aem_restore_factory_data();
+            if (s_ui->bg == NULL)
+                return;
+
+            lv_obj_clean(s_ui->bg);
+            s_ui->anim = lv_animimg_create(s_ui->bg);
+            if (s_ui->anim == NULL)
+                return;
+
+            lv_obj_center(s_ui->anim);
+            lv_animimg_set_src(s_ui->anim, loading_img, LOADING_IMG_CNT);
+            lv_animimg_set_duration(s_ui->anim, LOADING_IMG_CNT * 50);
+            lv_animimg_start(s_ui->anim);
+            break;
+        }
+        case AEM_RESET:
+        {
+            on_off.type = AEM_POWER_OFF_RETURN_FACTORY;
+            aem_power_off_main(&on_off);
+            break;
+        }
+        case AEM_RESTART:
+        {
+            on_off.type = AEM_POWER_OFF_WITH_REBOOT;
+            aem_power_off_main(&on_off);
+            break;
+        }
+        case AEM_POWER_OFF:
+        {
+            on_off.type = AEM_POWER_OFF_NORMAL;
+            aem_power_off_main(&on_off);
+            break;
+        }
+        case AEM_BLUETOOTH:
+        {
+            aem_app_goback();
+            break;
+        }
+        default:
+            return;
+            break;
+        }
+    }
+}
+
+static void create_ui(void)
+{
+    if (s_ui != NULL)
+        return;
+
+    s_ui = (bt_connect_more_ui_t *)lv_mem_alloc(sizeof(bt_connect_more_ui_t));
+
+    if (s_ui == NULL)
+    {
+        return;
+    }
+    lv_memset(s_ui, 0, sizeof(bt_connect_more_ui_t));
+
+    res_string_id_e _str_ids[2] = { 0 };
+
+    _str_ids[0] = ID_KEY_SETTINGS_SYSTEM_CONNECT_TO;
+    _str_ids[1] = ID_KEY_SETTINGS_SYSTEM_DISCONNECT_T;
+
+    s_ui->bg = aem_bg_create(lv_scr_act(), DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
+    if (s_ui->bg == NULL)
+        return;
+
+    lv_obj_t *title = aem_title_create(s_ui->bg, false, res_manager_get_string_from_id(_str_ids[0]));
+    if (title)
+    {
+        lv_obj_clear_flag(title, LV_OBJ_FLAG_CLICKABLE);
+    }
+
+    lv_obj_t *tips_bg = aem_bg_create(s_ui->bg, AEM_SIZE_FACTOR_466(tipe_w), AEM_SIZE_FACTOR_466(tipe_h), lv_color_black());
+    if (title && tips_bg)
+    {
+        lv_obj_align_to(tips_bg, title, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
+        lv_obj_add_flag(tips_bg, LV_OBJ_FLAG_SCROLLABLE);
+    }
+
+    lv_obj_t *tips = text_canvas_create(tips_bg);
+    if (tips)
+    {
+        lv_obj_set_width(tips, AEM_SIZE_FACTOR_466(tipe_w));
+        lv_obj_set_style_text_align(tips, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
+        lv_obj_set_style_text_color(tips, lv_color_white(), LV_PART_MAIN);
+        lv_obj_set_style_text_font(tips, aem_font_def(), LV_PART_MAIN);
+        lv_obj_add_flag(tips, LV_OBJ_FLAG_CLICKABLE);
+
+        text_canvas_set_text(tips, res_manager_get_string_from_id(_str_ids[1]));
+        lv_img_dsc_t *src = text_canvas_get_img(tips);
+        if (src && (tipe_h > src->header.h))
+        {
+            lv_obj_set_style_pad_top(tips, AEM_SIZE_FACTOR_466(bt_connect_more_pad_top), LV_PART_MAIN);
+        }
+    }
+
+    s_ui->cancel = aem_img_btn_create(s_ui->bg, &IMG_SCENE_WIDGET_PIC_CANCEL);
+    if (s_ui->cancel)
+    {
+        aem_img_btn_set_click_cb(s_ui->cancel, (aem_img_btn_click_cb)btn_click_cb);
+        lv_obj_align(s_ui->cancel, LV_ALIGN_BOTTOM_MID, -AEM_SIZE_FACTOR_466(bt_connect_more_btn_x), AEM_SIZE_FACTOR_466(bt_connect_more_btn_y));
+    }
+
+    s_ui->ok = aem_img_btn_create(s_ui->bg, &IMG_SCENE_WIDGET_PIC_BLUE_OK);
+    if (s_ui->ok)
+    {
+        aem_img_btn_set_click_cb(s_ui->ok, (aem_img_btn_click_cb)btn_click_cb);
+        lv_obj_align(s_ui->ok, LV_ALIGN_BOTTOM_MID, AEM_SIZE_FACTOR_466(bt_connect_more_btn_x), AEM_SIZE_FACTOR_466(bt_connect_more_btn_y));
+    }
+}
+
+static void on_start(void)
+{
+    create_ui();
+}
+
+static void on_resume(void)
+{
+}
+static void on_pause(void)
+{
+}
+
+static void on_stop()
+{
+    if (s_ui)
+    {
+        if (s_ui->bg)
+        {
+            lv_obj_del(s_ui->bg);
+            s_ui->bg = NULL;
+        }
+
+        lv_mem_free(s_ui);
+        s_ui = NULL;
+    }
+}
+
+static void on_ui_refr_evt(aem_msg_t *msg)
+{
+    if (msg == NULL || s_ui == NULL)
+    {
+        return;
+    }
+
+    if (UI_DATA_RESET_END == msg->sub_type)
+    {
+        aem_activity_run(AEM_BIND_MAIN, NULL);
+        aem_app_close(AEM_APP_ID_LAUNCH);
+        if (s_ui && s_ui->anim)
+        {
+            lv_obj_del(s_ui->anim);
+            s_ui->anim = NULL;
+        }
+    }
+}
+
+static aem_act_handler_t msg_handler =
+{
+    .name = ACTIVITY_ID,
+    .on_create_func = on_start,
+    .on_resume_func = on_resume,
+    .on_suspend_func = on_pause,
+    .on_destroy_func = on_stop,
+    .on_ui_refresh_func = on_ui_refr_evt,
+    .user_data = NULL,
+};
+
+int aem_bt_connect_more_create(void *user_data)
+{
+    type = (aem_system_type_e)user_data;
+    return aem_activity_create(ACTIVITY_ID, msg_handler);
+}
+
+AEM_ACTIVITY_DEFINE(AEM_SET_BT_CONNECT_MORE, aem_bt_connect_more_create);

+ 13 - 12
application/aem_watch/src/user_cfg/data_default_cfg.h

@@ -109,9 +109,9 @@ const static char *s_def_datetime_str = "2024-03-01 08:00:00"; // 默认系统
 
 #define AEM_MONKEY_HOME_KEY_EVENT 0x4000001 // 按键定义
 
-#define AEM_BAROMETER_SUPPORT (1) // 气压计支持
+#define AEM_BAROMETER_SUPPORT (0) // 气压计支持
 
-#define AEM_MINI_CHARGER_SUPPORT (1) // 低电模式支持
+#define AEM_MINI_CHARGER_SUPPORT (0) // 低电模式支持
 
 #define AEM_GESTURE_DETECT_WIDTH (50)    // 手势检测宽度
 
@@ -119,18 +119,19 @@ const static char *s_def_datetime_str = "2024-03-01 08:00:00"; // 默认系统
 typedef enum
 {
     AEM_QUICK_SETTING_START,
-    AEM_QUICK_SETTING_SCREEN_LOCK,
-    AEM_QUICK_SETTING_MUTE_MODE,
+    //AEM_QUICK_SETTING_SCREEN_LOCK,
+    //AEM_QUICK_SETTING_MUTE_MODE,
     AEM_QUICK_SETTING_SETTINGS,
-    AEM_QUICK_SETTING_PHONE_MODE,
+    //AEM_QUICK_SETTING_PHONE_MODE,
     AEM_QUICK_SETTING_DISPLAY_OFF,
-    AEM_QUICK_SETTING_BRIGHTNESS,
-    AEM_QUICK_SETTING_DND,
-    AEM_QUICK_SETTING_DRAIN,
-    AEM_QUICK_SETTING_FLASHLIGHT,
-    AEM_QUICK_SETTING_RAISE_UP,
-    AEM_QUICK_SETTING_POWER_SAVE_MODE,
-    AEM_QUICK_SETTING_FIND_PHONE,
+    //AEM_QUICK_SETTING_BRIGHTNESS,
+    //AEM_QUICK_SETTING_DND,
+    //AEM_QUICK_SETTING_DRAIN,
+    //AEM_QUICK_SETTING_FLASHLIGHT,
+    //AEM_QUICK_SETTING_RAISE_UP,
+    //AEM_QUICK_SETTING_POWER_SAVE_MODE,
+    //AEM_QUICK_SETTING_FIND_PHONE,
+    AEM_QUICK_SETTING_BLUETOOTH_SETTING,
     AEM_QUICK_SETTING_ALARM,
     AEM_QUICK_SETTING_END,
 } aem_quick_setting_prio_e;

+ 4 - 4
framework/bluetooth/bt_manager/bt_manager.c

@@ -282,7 +282,7 @@ static void bt_mgr_start_open_bt(void)
 #endif
 #ifdef CONFIG_BT_BLE
 #ifndef CONFIG_OTA_BLE_MASTER_SUPPORT
-	bt_manager_ble_adv_start();
+	//bt_manager_ble_adv_start();
 #endif
 #endif
 
@@ -291,8 +291,8 @@ static void bt_mgr_start_open_bt(void)
 	bt_manager_set_visible(false);
 	bt_manager_set_connectable(false);
 #else
-	bt_manager_set_visible(true);
-	bt_manager_set_connectable(true);
+	//bt_manager_set_visible(true);
+	//bt_manager_set_connectable(true);
 #endif
 
 	if (!bt_manager_config_pts_test()) {
@@ -1326,7 +1326,7 @@ static void bt_temp_comp_timer_handler(struct k_work* work)
 		} else if (bt_mgr_info.temp_comp_runing_flag == 0) {
 			SYS_LOG_INF("temperature %d.%d", temp / 10, abs(temp % 10));
 		} else {
-			//高低温时打开,确认打印温度用
+			//楂樹綆娓╂椂鎵撳紑锛岀‘璁ゆ墦鍗版俯搴︾敤
 			//SYS_LOG_INF("temperature %d.%d", temp / 10, abs(temp % 10));
 		}
 	}

+ 4 - 4
framework/bluetooth/bt_manager/bt_manager_connect.c

@@ -272,11 +272,11 @@ void bt_manager_halt_phone(void)
 void bt_manager_resume_phone(void)
 {
 	if(halted_phone) {
-		bt_manager_startup_reconnect_phone();
-		bt_manager_set_visible(true);
-		bt_manager_set_connectable(true);
+		//bt_manager_startup_reconnect_phone();
+		//bt_manager_set_visible(true);
+		//bt_manager_set_connectable(true);
 		halted_phone = false;
-		SYS_LOG_INF("BMC resume phone");
+		//SYS_LOG_INF("BMC resume phone");
 	}
 }
 

+ 1 - 0
thirdparty/lib/aem/include/aem_activity_id.h

@@ -17,6 +17,7 @@ typedef enum
     AEM_SLIDING_EFFECT,
     AEM_SET_BLUETOOTH,
     AEM_SET_BT_OPERATE,
+    AEM_SET_BT_CONNECT_MORE,
     AEM_SET_SOUND_VIBRATION,
     AEM_SET_DISPLAY,
     AEM_SET_SCREEN_TIME,

Някои файлове не бяха показани, защото твърде много файлове са промени