BLE: use std::min where appropriate.

pull/8738/head
Vincent Coubard 2018-11-10 13:43:18 +00:00
parent a628eba212
commit d63c7bc948
2 changed files with 2 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class GenericGap : public ::Gap,
public:
/* TODO: move to config */
static const size_t MAX_ADVERTISING_SETS = 15;
static const uint8_t MAX_ADVERTISING_SETS = 15;
static const size_t MAX_HCI_DATA_LENGTH = 251;
/**
* Construct a GenericGap instance for a given BLE instance ID.

View File

@ -1579,8 +1579,7 @@ void GenericGap::set_connection_event_handler(pal::ConnectionEventMonitor::Event
uint8_t GenericGap::getMaxAdvertisingSetNumber()
{
uint8_t set_number = _pal_gap.get_max_number_of_advertising_sets();
set_number = MAX_ADVERTISING_SETS < set_number ? MAX_ADVERTISING_SETS : set_number;
return set_number;
return std::min(MAX_ADVERTISING_SETS, set_number);
}
uint8_t GenericGap::getMaxAdvertisingDataLength()