BLE: Fix the number of advertising sets supported

The number of advertising sets supported is the minimum of advertising sets supported beween the host and the controller.
pull/8998/head
Vincent Coubard 2018-12-07 13:26:35 +00:00
parent 4e5240b743
commit e7f81fe7e8
1 changed files with 1 additions and 1 deletions

View File

@ -923,7 +923,7 @@ uint16_t Gap::get_maximum_advertising_data_length()
uint8_t Gap::get_max_number_of_advertising_sets() uint8_t Gap::get_max_number_of_advertising_sets()
{ {
return HciGetNumSupAdvSets(); return std::min(HciGetNumSupAdvSets(), (uint8_t) DM_NUM_ADV_SETS);
} }
ble_error_t Gap::remove_advertising_set(advertising_handle_t advertising_handle) ble_error_t Gap::remove_advertising_set(advertising_handle_t advertising_handle)