17static constexpr size_t MaxBleNameLenght = 32;
20void load_bound_file();
32bool is_bounded(std::array<uint8_t, 8>& buffer);
88size_t write(
const char*
const buffer,
size_t bufferSize);
bool is_connected()
Return true if a bluetooth user is connected.
Definition: ble.cpp:427
void force_pairing_mode()
Start the pairing mode (open to all devices), even if a device is connected. The connected device is ...
Definition: ble.cpp:538
void init()
Optional bypass to start the BLE device early, without advertising.
Definition: ble.cpp:573
bool is_activated()
Return true if the bluetooth is activated.
Definition: ble.cpp:421
bool is_advertising()
Return true is the bluetooth is visible by other devices.
Definition: ble.cpp:423
void stop_bluetooth_advertising()
disable the bluetooth advertising, but not the bluetooth
Definition: ble.cpp:555
std::array< char, MaxBleNameLenght > get_ble_name()
Return the current bluetooth name.
Definition: ble.cpp:485
void write_battery_level(const uint8_t batteryLevel)
update battery level
Definition: ble.cpp:564
bool is_connection_allowed(uint16_t connectionHandle)
If this returns false, do not accept any actions from bluetooth.
Definition: ble.cpp:449
void shutdown()
shutdown the bluetooth and services
Definition: ble.cpp:616
bool is_open_to_all()
Return true if the device is advertising, and all can connect.
Definition: ble.cpp:425
bool is_bounded()
Return true if the bluetooth connection is bounded to a pair.
Definition: ble.cpp:429
void start_advertising(bool allowUnknownConnections)
start the advertising sequence (with a timeout)
Definition: ble.cpp:492
bool was_used()
Return tue if the bluetooth was used during lifetime.
Definition: ble.cpp:571
void notify_battery_level(const uint8_t batteryLevel)
notify the connected device of a battery level
Definition: ble.cpp:566
void clear_bounded_devices()
Clear the bounded bluetooth devices.
Definition: ble.cpp:456
bool set_bluetooth_name(const std::array< char, MaxBleNameLenght > &name)
Set a new name for the bluetooth.
Definition: ble.cpp:467
Program scope.
Definition: control_fixed_modes.hpp:14