mirror of https://github.com/ARMmbed/mbed-os.git
BLE: use std::min where appropriate.
parent
a628eba212
commit
d63c7bc948
|
@ -48,7 +48,7 @@ class GenericGap : public ::Gap,
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* TODO: move to config */
|
/* 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;
|
static const size_t MAX_HCI_DATA_LENGTH = 251;
|
||||||
/**
|
/**
|
||||||
* Construct a GenericGap instance for a given BLE instance ID.
|
* Construct a GenericGap instance for a given BLE instance ID.
|
||||||
|
|
|
@ -1579,8 +1579,7 @@ void GenericGap::set_connection_event_handler(pal::ConnectionEventMonitor::Event
|
||||||
uint8_t GenericGap::getMaxAdvertisingSetNumber()
|
uint8_t GenericGap::getMaxAdvertisingSetNumber()
|
||||||
{
|
{
|
||||||
uint8_t set_number = _pal_gap.get_max_number_of_advertising_sets();
|
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 std::min(MAX_ADVERTISING_SETS, set_number);
|
||||||
return set_number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t GenericGap::getMaxAdvertisingDataLength()
|
uint8_t GenericGap::getMaxAdvertisingDataLength()
|
||||||
|
|
Loading…
Reference in New Issue