From 2acb28428d8d4f388efe8fbe9eacbbc8dcc04cd5 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 15 Aug 2024 15:18:24 +0200 Subject: [PATCH] gatt_client: add fields for gatt service changed feature --- src/ble/gatt_client.h | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/ble/gatt_client.h b/src/ble/gatt_client.h index 3ec7b13d1..da05f22ae 100644 --- a/src/ble/gatt_client.h +++ b/src/ble/gatt_client.h @@ -144,7 +144,7 @@ typedef enum { P_W2_EMIT_CONNECTED, P_L2CAP_CLOSED, } gatt_client_state_t; - + typedef enum{ SEND_MTU_EXCHANGE, @@ -153,6 +153,20 @@ typedef enum{ MTU_AUTO_EXCHANGE_DISABLED } gatt_client_mtu_t; +typedef enum { + GATT_CLIENT_SERVICE_DISCOVER_W2_SEND, + GATT_CLIENT_SERVICE_DISCOVER_W4_DONE, + GATT_CLIENT_SERVICE_DISCOVER_CHARACTERISTICS_W2_SEND, + GATT_CLIENT_SERVICE_DISCOVER_CHARACTERISTICS_W4_DONE, + GATT_CLIENT_SERVICE_SERVICE_CHANGED_WRITE_CCCD_W2_SEND, + GATT_CLIENT_SERVICE_SERVICE_CHANGED_WRITE_CCCD_W4_DONE, + GATT_CLIENT_SERVICE_DATABASE_HASH_READ_W2_SEND, + GATT_CLIENT_SERVICE_DATABASE_HASH_READ_W4_DONE, + GATT_CLIENT_SERVICE_DATABASE_HASH_WRITE_CCCD_W2_SEND, + GATT_CLIENT_SERVICE_DATABASE_HASH_WRITE_CCCD_W4_DONE, + GATT_CLIENT_SERVICE_DONE, +} gatt_client_service_state_t; + #ifdef ENABLE_GATT_OVER_EATT typedef enum { GATT_CLIENT_EATT_IDLE, @@ -207,8 +221,6 @@ typedef struct gatt_client{ uint16_t eatt_storage_size; uint8_t eatt_num_clients; uint8_t gatt_server_supported_features; - uint16_t gatt_service_start_group_handle; - uint16_t gatt_service_end_group_handle; uint16_t gatt_client_supported_features_handle; #endif @@ -256,6 +268,19 @@ typedef struct gatt_client{ gap_security_level_t security_level; + // GATT Service Changes + gatt_client_service_state_t gatt_service_state; + uint16_t gatt_service_start_group_handle; + uint16_t gatt_service_end_group_handle; + // - Service Changed + uint16_t gatt_service_changed_value_handle; + uint16_t gatt_service_changed_cccd_handle; + uint16_t gatt_service_changed_end_handle; + // - Database Hash + uint16_t gatt_service_database_hash_value_handle; + uint16_t gatt_service_database_hash_cccd_handle; + uint16_t gatt_service_database_hash_end_handle; + } gatt_client_t; typedef struct gatt_client_notification {