@@ -84,6 +84,11 @@ typedef struct zjs_ble_handle {
84
84
ble_connection_t * connections ;
85
85
} ble_handle_t ;
86
86
87
+ static struct bt_uuid * gatt_primary_service_uuid = BT_UUID_GATT_PRIMARY ;
88
+ static struct bt_uuid * gatt_characteristic_uuid = BT_UUID_GATT_CHRC ;
89
+ static struct bt_uuid * gatt_cud_uuid = BT_UUID_GATT_CUD ;
90
+ static struct bt_uuid * gatt_ccc_uuid = BT_UUID_GATT_CCC ;
91
+
87
92
static struct k_sem ble_sem ;
88
93
89
94
static ble_handle_t * ble_handle = NULL ;
@@ -1032,7 +1037,7 @@ static bool zjs_ble_register_service(ble_service_t *service)
1032
1037
memset (bt_attrs , 0 , sizeof (struct bt_gatt_attr ) * num_of_entries );
1033
1038
1034
1039
// GATT Primary Service
1035
- bt_attrs [entry_index ].uuid = BT_UUID_GATT_PRIMARY ;
1040
+ bt_attrs [entry_index ].uuid = gatt_primary_service_uuid ;
1036
1041
bt_attrs [entry_index ].perm = BT_GATT_PERM_READ ;
1037
1042
bt_attrs [entry_index ].read = bt_gatt_attr_read_service ;
1038
1043
bt_attrs [entry_index ].user_data = service -> uuid ;
@@ -1052,7 +1057,7 @@ static bool zjs_ble_register_service(ble_service_t *service)
1052
1057
1053
1058
chrc_user_data -> uuid = ch -> uuid ;
1054
1059
chrc_user_data -> properties = ch -> flags ;
1055
- bt_attrs [entry_index ].uuid = BT_UUID_GATT_CHRC ;
1060
+ bt_attrs [entry_index ].uuid = gatt_characteristic_uuid ;
1056
1061
bt_attrs [entry_index ].perm = BT_GATT_PERM_READ ;
1057
1062
bt_attrs [entry_index ].read = bt_gatt_attr_read_chrc ;
1058
1063
bt_attrs [entry_index ].user_data = chrc_user_data ;
@@ -1089,7 +1094,7 @@ static bool zjs_ble_register_service(ble_service_t *service)
1089
1094
// FIXME: cud_buffer should be freed later if no longer needed, but
1090
1095
// doesn't seem to be
1091
1096
1092
- bt_attrs [entry_index ].uuid = BT_UUID_GATT_CUD ;
1097
+ bt_attrs [entry_index ].uuid = gatt_cud_uuid ;
1093
1098
bt_attrs [entry_index ].perm = BT_GATT_PERM_READ ;
1094
1099
bt_attrs [entry_index ].read = bt_gatt_attr_read_cud ;
1095
1100
bt_attrs [entry_index ].user_data = cud_buffer ;
@@ -1111,7 +1116,7 @@ static bool zjs_ble_register_service(ble_service_t *service)
1111
1116
ccc_user_data -> cfg = ble_handle -> blvl_ccc_cfg ;
1112
1117
ccc_user_data -> cfg_len = ARRAY_SIZE (ble_handle -> blvl_ccc_cfg );
1113
1118
ccc_user_data -> cfg_changed = zjs_ble_blvl_ccc_cfg_changed ;
1114
- bt_attrs [entry_index ].uuid = BT_UUID_GATT_CCC ;
1119
+ bt_attrs [entry_index ].uuid = gatt_ccc_uuid ;
1115
1120
bt_attrs [entry_index ].perm = BT_GATT_PERM_READ | BT_GATT_PERM_WRITE ;
1116
1121
bt_attrs [entry_index ].read = bt_gatt_attr_read_ccc ;
1117
1122
bt_attrs [entry_index ].write = bt_gatt_attr_write_ccc ;
0 commit comments