Просмотр исходного кода

Add 128bit uuid to advertisement

Eric Betts 10 месяцев назад
Родитель
Сommit
0bd8a1176b
2 измененных файлов с 7 добавлено и 4 удалено
  1. 6 4
      seos_profile.c
  2. 1 0
      seos_service_uuid.inc

+ 6 - 4
seos_profile.c

@@ -3,6 +3,8 @@
 #include <gap.h>
 #include <gap.h>
 #include <furi_ble/profile_interface.h>
 #include <furi_ble/profile_interface.h>
 #include "seos_service.h"
 #include "seos_service.h"
+#include "seos_service_uuid.inc"
+#include <ble/core/ble_defs.h>
 #include <furi.h>
 #include <furi.h>
 
 
 #define TAG "SeosProfile"
 #define TAG "SeosProfile"
@@ -41,10 +43,11 @@ static void ble_profile_seos_stop(FuriHalBleProfileBase* profile) {
 #define CONNECTION_INTERVAL_MAX (0x24)
 #define CONNECTION_INTERVAL_MAX (0x24)
 
 
 static GapConfig seos_template_config = {
 static GapConfig seos_template_config = {
-    .adv_service_uuid = 0x3080,
+    .adv_service.UUID_Type = UUID_TYPE_128,
+    .adv_service.Char_UUID_128 = BLE_SVC_SEOS_CHAR_UUID,
     .appearance_char = 0x8600,
     .appearance_char = 0x8600,
-    .bonding_mode = true,
-    .pairing_method = GapPairingPinCodeShow,
+    .bonding_mode = false,
+    .pairing_method = GapPairingNone,
     .conn_param = {
     .conn_param = {
         .conn_int_min = CONNECTION_INTERVAL_MIN,
         .conn_int_min = CONNECTION_INTERVAL_MIN,
         .conn_int_max = CONNECTION_INTERVAL_MAX,
         .conn_int_max = CONNECTION_INTERVAL_MAX,
@@ -65,7 +68,6 @@ static void
         config->adv_name,
         config->adv_name,
         furi_hal_version_get_ble_local_device_name_ptr(),
         furi_hal_version_get_ble_local_device_name_ptr(),
         FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
         FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
-    config->adv_service_uuid |= furi_hal_version_get_hw_color();
 }
 }
 
 
 static const FuriHalBleProfileTemplate profile_callbacks = {
 static const FuriHalBleProfileTemplate profile_callbacks = {

+ 1 - 0
seos_service_uuid.inc

@@ -1,3 +1,4 @@
+#include <ble/core/auto/ble_types.h>
 
 
 static const Service_UUID_t service_uuid = { .Service_UUID_128 = \
 static const Service_UUID_t service_uuid = { .Service_UUID_128 = \
     {0x02, 0x00, 0x00, 0x7a, 0x17, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00 }};
     {0x02, 0x00, 0x00, 0x7a, 0x17, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00 }};