Skip to content

Commit

Permalink
Change type of index to int (instead of uint8_t)
Browse files Browse the repository at this point in the history
This fixes an issue with adding more than 255 Characteristics (or Descriptors).
  • Loading branch information
csmith-morningstar authored and h2zero committed Nov 25, 2023
1 parent 530a2a1 commit e46123a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NimBLEService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,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;
Expand Down Expand Up @@ -189,7 +189,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;
Expand Down

0 comments on commit e46123a

Please sign in to comment.