pabigot
0.1.1
C++ support classes
|
Go to the documentation of this file. 7 #ifndef PABIGOT_BLE_HPP 8 #define PABIGOT_BLE_HPP 33 template <
unsigned int clock_bit>
34 using clk_type = std::chrono::duration<uint32_t, std::ratio<(1U << clock_bit), 3200>>;
42 template <std::
size_t nb>
46 using super_type = std::array<uint8_t, nb>;
64 constexpr uuid_type (
const super_type& arr) :
68 constexpr uuid_type (super_type& arr) :
72 constexpr uuid_type (
const uint8_t (&arr)[
byte_length]) :
89 template <
typename Int>
93 using integer_type = Int;
98 std::copy(uuid.begin(), uuid.end(), &u.u8);
141 using super_type::super_type;
174 using super_type::super_type;
190 return details::to_integer<integer_type>(*
this);
228 using super_type::super_type;
241 bool base_match (const
uuid128_type& other) const noexcept;
273 #if (PABIGOT_OPTION_FULLCPP - 0) 274 #include <pabigot/ble/fullcpp.hpp>
details::clk_type< 1 > clk1_type
A duration type that measures in 625 us ticks.
Definition: ble.hpp:111
constexpr uuid16_type(integer_type src)
Construct an instance from a native integral UUID.
Definition: ble.hpp:144
integer_type as_integer() const noexcept
Convert the UUID to its host integral representation.
Definition: ble.hpp:188
static const uuid128_type BLUETOOTH_BASE
The Bluetooth Base UUID.
Definition: ble.hpp:225
constexpr uuid32_type(integer_type src)
Construct an instance from a native integral UUID.
Definition: ble.hpp:177
static constexpr std::size_t bit_length
The length of the UUID in bits.
Definition: ble.hpp:52
Base class that captures 2, 4, or 16-byte UUIDs.
Definition: ble.hpp:43
Support for byte order manipulation and packed storage.
uint32_t integer_type
Native integer type for 32-bit UUID.
Definition: ble.hpp:171
details::clk_type< 5 > clk5_type
A duration type that measures in 10 ms ticks.
Definition: ble.hpp:129
uint16_t integer_type
Native integer type for 16-bit UUID.
Definition: ble.hpp:138
std::chrono::duration< uint32_t, std::ratio<(1U<< clock_bit), 3200 > > clk_type
Template for durations corresponding to bits in the 3.2 kHz Bluetooth native clock.
Definition: ble.hpp:34
Root for all pabigot namespaces.
Definition: gap.hpp:15
constexpr Int to_integer(const uuid_type< sizeof(Int)> &uuid) noexcept
Convert a small UUID to its native integer type.
Definition: ble.hpp:91
constexpr std::enable_if< details::is_constexpr_swappable_v< T >, T >::type host_x_le(const T &v)
Convert between host and little-endian byte order.
Definition: byteorder.hpp:233
integer_type as_integer() const noexcept
Convert the UUID to its host integral representation.
std::string as_string() const noexcept
Convert the UUID to its standard text representation.
32-bit UUID type stored as a little-endian byte sequence.
Definition: ble.hpp:165
details::clk_type< 2 > clk2_type
A duration type that measures in 1.25 ms ticks.
Definition: ble.hpp:120
static constexpr std::size_t byte_length
The length of the UUID in bytes.
Definition: ble.hpp:49
Basic holder for 128-bit UUIDs stored as a little-endian byte sequence.
Definition: ble.hpp:217
16-bit UUID type stored as a little-endian byte sequence.
Definition: ble.hpp:132