1#ifndef BLUETOE_UUID_HPP
2#define BLUETOE_UUID_HPP
7 template < std::u
int64_t A, std::u
int64_t B, std::u
int64_t C, std::u
int64_t D, std::u
int64_t E >
8 struct check_uuid_parameters
10 static_assert( A < 0x100000000,
"uuid: first group of bytes can not be longer than 4 bytes." );
11 static_assert( B < 0x10000,
"uuid: second group of bytes can not be longer than 2 bytes." );
12 static_assert( C < 0x10000,
"uuid: third group of bytes can not be longer than 2 bytes." );
13 static_assert( D < 0x10000,
"uuid: 4th group of bytes can not be longer than 2 bytes." );
14 static_assert( E < 0x1000000000000l,
"uuid: last group of bytes can not be longer than 6 bytes." );
18 template < std::u
int64_t UUID >
19 struct check_uuid_parameter16
21 static_assert( UUID < 0x10000,
"uuid16: a 16 bit UUID can not be longer than 4 bytes." );
39 typename =
typename details::check_uuid_parameters< A, B, C, D, E >::type >
42 static constexpr std::uint8_t bytes[ 16 ] = {
60 static constexpr bool is_128bit =
true;
62 static std::uint16_t as_16bit() {
74 constexpr std::uint8_t uuid< A, B, C, D, E, F >::bytes[ 16 ];
79 template < std::uint64_t UUID, typename = typename check_uuid_parameter16< UUID >::type >
82 static constexpr std::uint8_t bytes[ 2 ] = {
86 static constexpr bool is_128bit =
false;
88 static constexpr std::uint16_t as_16bit() {
93 template < std::u
int64_t UUID,
typename A >
94 constexpr std::uint8_t uuid16< UUID, A >::bytes[ 2 ];
99 struct bluetooth_base_uuid : uuid< 0x00000000 ,0x0000, 0x1000, 0x8000, 0x00805F9B34FB >
104 template < std::u
int64_t A >
105 using from_16bit = uuid< A ,0x0000, 0x1000, 0x8000, 0x00805F9B34FB > ;