pabigot  0.1.1
C++ support classes
Data Structures | Namespaces | Typedefs | Functions
ble.hpp File Reference

Infrastructure supporting Bluetooth Low Energy. More...

#include <algorithm>
#include <array>
#include <chrono>
#include <cstring>
#include <stdexcept>
#include <string>
#include <pabigot/byteorder.hpp>

Go to the source code of this file.

Data Structures

class  pabigot::ble::details::uuid_type< nb >
 Base class that captures 2, 4, or 16-byte UUIDs. More...
 
class  pabigot::ble::uuid16_type
 16-bit UUID type stored as a little-endian byte sequence. More...
 
class  pabigot::ble::uuid32_type
 32-bit UUID type stored as a little-endian byte sequence. More...
 
class  pabigot::ble::uuid128_type
 Basic holder for 128-bit UUIDs stored as a little-endian byte sequence. More...
 

Namespaces

 pabigot
 Root for all pabigot namespaces.
 
 pabigot::ble
 Various helpers for Bluetooth Low Energy activities.
 

Typedefs

template<unsigned int clock_bit>
using pabigot::ble::details::clk_type = std::chrono::duration< uint32_t, std::ratio<(1U<< clock_bit), 3200 > >
 Template for durations corresponding to bits in the 3.2 kHz Bluetooth native clock.
 
using pabigot::ble::clk1_type = details::clk_type< 1 >
 A duration type that measures in 625 us ticks. More...
 
using pabigot::ble::clk2_type = details::clk_type< 2 >
 A duration type that measures in 1.25 ms ticks. More...
 
using pabigot::ble::clk5_type = details::clk_type< 5 >
 A duration type that measures in 10 ms ticks. More...
 

Functions

template<typename Int >
constexpr Int pabigot::ble::details::to_integer (const uuid_type< sizeof(Int)> &uuid) noexcept
 Convert a small UUID to its native integer type. More...
 

Detailed Description

Infrastructure supporting Bluetooth Low Energy.

Function Documentation

◆ to_integer()

template<typename Int >
constexpr Int pabigot::ble::details::to_integer ( const uuid_type< sizeof(Int)> &  uuid)
constexprnoexcept

Convert a small UUID to its native integer type.

This handles any necessary host endian conversion from the little-endian standard storage.