Skip to content

Commit e46123a

Browse files
csmith-morningstarh2zero
authored andcommitted
Change type of index to int (instead of uint8_t)
This fixes an issue with adding more than 255 Characteristics (or Descriptors).
1 parent 530a2a1 commit e46123a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NimBLEService.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bool NimBLEService::start() {
160160
// of the characteristics for the service. We create 1 extra and set it to null
161161
// for this purpose.
162162
pChr_a = new ble_gatt_chr_def[numChrs + 1];
163-
uint8_t i = 0;
163+
int i = 0;
164164
for(auto chr_it = m_chrVec.begin(); chr_it != m_chrVec.end(); ++chr_it) {
165165
if((*chr_it)->m_removed > 0) {
166166
continue;
@@ -189,7 +189,7 @@ bool NimBLEService::start() {
189189
} else {
190190
// Must have last descriptor uuid = 0 so we have to create 1 extra
191191
pDsc_a = new ble_gatt_dsc_def[numDscs+1];
192-
uint8_t d = 0;
192+
int d = 0;
193193
for(auto dsc_it = (*chr_it)->m_dscVec.begin(); dsc_it != (*chr_it)->m_dscVec.end(); ++dsc_it ) {
194194
if((*dsc_it)->m_removed > 0) {
195195
continue;

0 commit comments

Comments
 (0)