BLE: rename ble::Forever into ble::Value.

pull/8738/head
Vincent Coubard 2018-11-23 15:41:08 +00:00
parent e9637c419a
commit 2a08549b8d
2 changed files with 9 additions and 8 deletions

View File

@ -68,13 +68,14 @@ struct DefaultRange<uint32_t> {
};
/**
* Represent the forever value that can be used in Duration.
* Represent an integral compile time value that can be used in Duration.
*
* @tparam T Type of the integral value.
* @tparam V The integer value representing a never ending duration.
*/
template<uint32_t V>
struct Forever {
static const uint32_t VALUE = V;
template<typename T, T V>
struct Value {
static const T VALUE = V;
};
/**
@ -513,8 +514,8 @@ const uint32_t Range<Min, Max>::MIN;
template<uint32_t Min, uint32_t Max>
const uint32_t Range<Min, Max>::MAX;
template<uint32_t V>
const uint32_t Forever<V>::VALUE;
template<typename T, T V>
const T Value<T, V>::VALUE;
template<typename Rep, uint32_t TB, typename Range, typename Forever>
const uint32_t Duration<Rep, TB, Range, Forever>::TIME_BASE;

View File

@ -25,8 +25,8 @@ namespace ble {
/* BLE units, using microseconds as the common denominator */
typedef Duration<uint32_t, 625, Range<0x20, 0xFFFFFF> > adv_interval_t;
typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, Forever<0x0000> > adv_duration_t;
typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, Forever<0x0000> > scan_duration_t;
typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, Value<uint16_t, 0x0000> > adv_duration_t;
typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, Value<uint16_t, 0x0000> > scan_duration_t;
typedef Duration<uint16_t, 1280000, Range<0x00, 0xFFFF> > scan_period_t;
typedef Duration<uint16_t, 625, Range<0x04, 0xFFFF> > scan_interval_t;
typedef Duration<uint16_t, 625, Range<0x04, 0xFFFF> > scan_window_t;