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]; } }