Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
bluetooth.h File Reference

Interface for the platform specific bluetooth. More...

Go to the source code of this file.

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::hal
 Hardware Abstraction Layer, handle the platform specific interactions. Can be changed to support different platforms.
 
namespace  lampda::hal::bluetooth
 Handle the platform specific bluetooth operations.
 

Functions

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

Variables

static constexpr size_t lampda::hal::bluetooth::MaxBleNameLenght = 32
 

Detailed Description

Interface for the platform specific bluetooth.