1#ifndef BLUETOE_PERIPHERAL_CONNECTION_INTERVAL_RANGE_HPP
2#define BLUETOE_PERIPHERAL_CONNECTION_INTERVAL_RANGE_HPP
5 static constexpr std::uint16_t no_specific_peripheral_connection_minimum_interval = 0xFFFF;
6 static constexpr std::uint16_t no_specific_peripheral_connection_maximum_interval = 0xFFFF;
9 struct peripheral_connection_interval_range_meta_type {};
12 std::uint16_t MinInterval,
13 std::uint16_t MaxInterval >
14 struct check_peripheral_connection_interval_range_parameters
16 static_assert( ( MinInterval >= 0x0006 && MinInterval <= 0x0C80 ) || MinInterval == no_specific_peripheral_connection_minimum_interval,
17 "Invalid value for peripheral_connection_interval_range first template parameter (MinInterval) used!" );
19 static_assert( ( MaxInterval >= 0x0006 && MaxInterval <= 0x0C80 ) || MaxInterval == no_specific_peripheral_connection_maximum_interval,
20 "Invalid value for peripheral_connection_interval_range second template parameter (MaxInterval) used!" );
22 static_assert( MinInterval <= MaxInterval || MinInterval == no_specific_peripheral_connection_minimum_interval || MaxInterval == no_specific_peripheral_connection_maximum_interval,
23 "when defining the peripheral_connection_interval_range, the minimum shall not be greater than the maximum value!" );
28 struct no_peripheral_connection_interval_range
30 typedef peripheral_connection_interval_range_meta_type meta_type;
32 static std::uint8_t* advertising_data( std::uint8_t* begin, std::uint8_t* )
48 std::uint16_t MinInterval = no_specific_peripheral_connection_minimum_interval,
49 std::uint16_t MaxInterval = no_specific_peripheral_connection_maximum_interval,
50 typename =
typename details::check_peripheral_connection_interval_range_parameters< MinInterval, MaxInterval >::type
56 details::peripheral_connection_interval_range_meta_type,
57 details::valid_server_option_meta_type {};
59 static std::uint8_t* advertising_data( std::uint8_t* begin, std::uint8_t* end )
61 if ( end - begin >= 6 )
68 begin = details::write_16bit( begin, MinInterval );
69 begin = details::write_16bit( begin, MaxInterval );
add peripheral connection interval range to advertising data
Definition: peripheral_connection_interval_range.hpp:53