From 01063a014cc00c4ac1569f812cad0311ba758306 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 26 Jun 2023 17:33:50 +0200 Subject: [PATCH] service print fix --- BLEh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BLEh.c b/BLEh.c index 2824e08..6c749a1 100644 --- a/BLEh.c +++ b/BLEh.c @@ -280,7 +280,8 @@ void print_char(struct ble_gatt_chr_def chr){ void print_service(struct ble_gatt_svc_def* svcs){ int svc_id = 0; struct ble_gatt_svc_def svc = svcs[svc_id]; - for(svc_id = 0; svc.uuid != NULL; svc_id++){ + for(svc_id = 0; svcs[svc_id].uuid != NULL; svc_id++){ + svc = svcs[svc_id]; ESP_LOGI(TAG, "svc %d", svc_id); struct ble_gatt_chr_def chr = svc.characteristics[0]; int ind = 0; @@ -291,8 +292,6 @@ void print_service(struct ble_gatt_svc_def* svcs){ ind++; chr = svc.characteristics[ind]; } - - svc = svcs[svc_id]; } }