fix(protocomm): Add GATT service initialization that when gatt service changed, the peer can refresh gatt service

This commit is contained in:
Jim
2026-05-11 10:11:51 +08:00
parent c5e8334592
commit 3edb108920
@@ -21,6 +21,7 @@
#include "host/ble_uuid.h" #include "host/ble_uuid.h"
#include "host/util/util.h" #include "host/util/util.h"
#include "services/gap/ble_svc_gap.h" #include "services/gap/ble_svc_gap.h"
#include "services/gatt/ble_svc_gatt.h"
static const char *TAG = "protocomm_nimble"; static const char *TAG = "protocomm_nimble";
@@ -472,6 +473,10 @@ int
gatt_svr_init(const simple_ble_cfg_t *config) gatt_svr_init(const simple_ble_cfg_t *config)
{ {
int rc; int rc;
/* GATT service initialization */
ble_svc_gatt_init();
rc = ble_gatts_count_cfg(config->gatt_db); rc = ble_gatts_count_cfg(config->gatt_db);
if (rc != 0) { if (rc != 0) {
return rc; return rc;