From 6fb26e380943f3d4097db00f4832aa289af4854a Mon Sep 17 00:00:00 2001 From: Casey Smith Date: Sun, 11 Sep 2022 21:54:15 -0400 Subject: [PATCH] Change type of index to int (instead of uint8_t) to fix issue with adding more than 255 Characteristics (or Descriptors) (#101) --- src/NimBLEService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NimBLEService.cpp b/src/NimBLEService.cpp index b124fcb..73f00a5 100644 --- a/src/NimBLEService.cpp +++ b/src/NimBLEService.cpp @@ -161,7 +161,7 @@ bool NimBLEService::start() { // of the characteristics for the service. We create 1 extra and set it to null // for this purpose. pChr_a = new ble_gatt_chr_def[numChrs + 1]; - uint8_t i = 0; + int i = 0; for(auto chr_it = m_chrVec.begin(); chr_it != m_chrVec.end(); ++chr_it) { if((*chr_it)->m_removed > 0) { continue; @@ -190,7 +190,7 @@ bool NimBLEService::start() { } else { // Must have last descriptor uuid = 0 so we have to create 1 extra pDsc_a = new ble_gatt_dsc_def[numDscs+1]; - uint8_t d = 0; + int d = 0; for(auto dsc_it = (*chr_it)->m_dscVec.begin(); dsc_it != (*chr_it)->m_dscVec.end(); ++dsc_it ) { if((*dsc_it)->m_removed > 0) { continue;