battery_service_client: increase num_instances only if the instance can be stored

This commit is contained in:
Milanka Ringwald 2021-03-25 09:10:26 +01:00
parent 813fc1b96d
commit dd57ce9fbd

View File

@ -302,8 +302,10 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint
#ifdef ENABLE_TESTING_SUPPORT
printf("Battery Service: start handle 0x%04X, end handle 0x%04X\n", client->services[client->num_instances].start_handle, client->services[client->num_instances].end_handle);
#endif
}
client->num_instances++;
} else {
log_info("Found more then %d, Battery Service instances. Increase MAX_NUM_BATTERY_SERVICES to store all.", MAX_NUM_BATTERY_SERVICES);
}
break;
case GATT_EVENT_CHARACTERISTIC_QUERY_RESULT: