libGulliBLE
ble::controller Class Reference

#include <controller.hpp>

Inheritance diagram for ble::controller:
Collaboration diagram for ble::controller:

Classes

struct  dyn_c_vec
 

Public Member Functions

 controller (std::vector< service > const &svcs)
 
 controller (controller &&) noexcept=delete
 
 controller (controller const &)=delete
 
controlleroperator= (controller &&) noexcept=delete
 
controlleroperator= (controller const &)=delete
 
void start ()
 
void stop ()
 
void advertise_start (std::chrono::milliseconds duration=0ms)
 
void advertise_stop ()
 
bool is_running () const
 
bool is_advertising () const
 
bool auto_advertise () const
 
void set_auto_advertise (bool aa)
 
std::string get_device_name () const
 
std::uint16_t get_device_appearance () const
 
void set_device_name (std::string const &new_name)
 
void set_device_appearance (std::uint16_t new_appearance)
 
void set_device_appearance (device_appearance new_appearance)
 
std::vector< service::snapshot > const & services () const
 
 ~controller ()
 

Protected Member Functions

void ensure_own_address ()
 
void configure_services (bool start_gatts_manually=false)
 

Static Private Member Functions

static void _nimble_main_task (void *)
 
static void _nimble_reset_cbk (int reason)
 
static void _nimble_sync_cbk ()
 
static int _nimble_on_gap_event_cbk (ble_gap_event *event, void *tracker)
 

Private Attributes

std::vector< service::snapshot_svc_snapshots
 
std::unique_ptr< ble_gatt_svc_def[]> _nimble_svc_defs
 
dyn_c_vec< ble_uuid16_t > _nimble_svc_uuid16
 
dyn_c_vec< ble_uuid32_t > _nimble_svc_uuid32
 
dyn_c_vec< ble_uuid128_t > _nimble_svc_uuid128
 
std::uint8_t _own_address
 
bool _auto_advertise
 

Constructor & Destructor Documentation

◆ controller() [1/3]

ble::controller::controller ( std::vector< service > const &  svcs)
explicit

◆ controller() [2/3]

ble::controller::controller ( controller &&  )
deletenoexcept

◆ controller() [3/3]

ble::controller::controller ( controller const &  )
delete

◆ ~controller()

ble::controller::~controller ( )

Member Function Documentation

◆ _nimble_main_task()

void ble::controller::_nimble_main_task ( void *  )
staticprivate

◆ _nimble_on_gap_event_cbk()

int ble::controller::_nimble_on_gap_event_cbk ( ble_gap_event *  event,
void *  tracker 
)
staticprivate

◆ _nimble_reset_cbk()

void ble::controller::_nimble_reset_cbk ( int  reason)
staticprivate

◆ _nimble_sync_cbk()

void ble::controller::_nimble_sync_cbk ( )
staticprivate

◆ advertise_start()

void ble::controller::advertise_start ( std::chrono::milliseconds  duration = 0ms)
Parameters
durationSpecify zero to advertise forever

◆ advertise_stop()

void ble::controller::advertise_stop ( )

◆ auto_advertise()

bool ble::controller::auto_advertise ( ) const
inline

◆ configure_services()

void ble::controller::configure_services ( bool  start_gatts_manually = false)
protected

◆ ensure_own_address()

void ble::controller::ensure_own_address ( )
protected

◆ get_device_appearance()

std::uint16_t ble::controller::get_device_appearance ( ) const

◆ get_device_name()

std::string ble::controller::get_device_name ( ) const

◆ is_advertising()

bool ble::controller::is_advertising ( ) const

◆ is_running()

bool ble::controller::is_running ( ) const

◆ operator=() [1/2]

controller & ble::controller::operator= ( controller &&  )
deletenoexcept

◆ operator=() [2/2]

controller & ble::controller::operator= ( controller const &  )
delete

◆ services()

std::vector< service::snapshot > const & ble::controller::services ( ) const
inline

◆ set_auto_advertise()

void ble::controller::set_auto_advertise ( bool  aa)
inline

◆ set_device_appearance() [1/2]

void ble::controller::set_device_appearance ( device_appearance  new_appearance)
inline

◆ set_device_appearance() [2/2]

void ble::controller::set_device_appearance ( std::uint16_t  new_appearance)

◆ set_device_name()

void ble::controller::set_device_name ( std::string const &  new_name)

◆ start()

void ble::controller::start ( )

◆ stop()

void ble::controller::stop ( )

Member Data Documentation

◆ _auto_advertise

bool ble::controller::_auto_advertise
private

◆ _nimble_svc_defs

std::unique_ptr<ble_gatt_svc_def[]> ble::controller::_nimble_svc_defs
private

◆ _nimble_svc_uuid128

dyn_c_vec<ble_uuid128_t> ble::controller::_nimble_svc_uuid128
private

◆ _nimble_svc_uuid16

dyn_c_vec<ble_uuid16_t> ble::controller::_nimble_svc_uuid16
private

◆ _nimble_svc_uuid32

dyn_c_vec<ble_uuid32_t> ble::controller::_nimble_svc_uuid32
private

◆ _own_address

std::uint8_t ble::controller::_own_address
private

◆ _svc_snapshots

std::vector<service::snapshot> ble::controller::_svc_snapshots
private

The documentation for this class was generated from the following files: