Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Functions | Variables
lampda::hal::bluetooth Namespace Reference

Handle the platform specific bluetooth operations. More...

Functions

void load_bound_file ()
 
bool is_activated ()
 Return true if the bluetooth is activated.
 
bool is_advertising ()
 Return true is the bluetooth is visible by other devices.
 
bool is_open_to_all ()
 Return true if the device is advertising, and all can connect.
 
bool is_connected ()
 Return true if a bluetooth user is connected.
 
bool is_bounded ()
 Return true if the bluetooth connection is bounded to a pair.
 
bool is_bounded (std::array< uint8_t, 8 > &buffer)
 
void disconnect ()
 Force disconnection.
 
bool is_connection_allowed (uint16_t connectionHandle)
 If this returns false, do not accept any actions from bluetooth.
 
void clear_bounded_devices ()
 Clear the bounded bluetooth devices.
 
bool set_bluetooth_name (const std::array< char, MaxBleNameLenght > &name)
 Set a new name for the bluetooth.
 
void start_advertising (bool allowUnknownConnections)
 start the advertising sequence (with a timeout)
 
void stop_bluetooth_advertising ()
 disable the bluetooth advertising, but not the bluetooth
 
void write_battery_level (const uint8_t batteryLevel)
 update battery level
 
void notify_battery_level (const uint8_t batteryLevel)
 notify the connected device of a battery level
 
bool was_used ()
 Return tue if the bluetooth was used during lifetime.
 
void init ()
 Optional bypass to start the BLE device early, without advertising.
 
void shutdown ()
 shutdown the bluetooth and services
 

Variables

static constexpr size_t MaxBleNameLenght = 32
 

Detailed Description

Handle the platform specific bluetooth operations.

Function Documentation

◆ start_advertising()

void lampda::hal::bluetooth::start_advertising ( bool  allowUnknownConnections)

start the advertising sequence (with a timeout)

Parameters
[in]allowUnknownConnectionsIf true, allow any device to be connected. If false, it will first check if a saved device exists, and if it's the case will only allow this device to connect.