Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
bluetooth.h
Go to the documentation of this file.
1
5#ifndef HAL_BLUETOOTH_HPP
6#define HAL_BLUETOOTH_HPP
7
8#include <stdint.h>
9#include <string>
10
12
13namespace lampda {
14namespace hal {
16namespace bluetooth {
17
19bool is_activated();
21bool is_advertising();
23bool is_connected();
24
25// start the advertising sequence (with a timeout)
26void start_advertising();
27
28// disable the bluetooth advertising, but not the bluetooth
29void stop_bluetooth_advertising();
30
31// update battery level
32void write_battery_level(const uint8_t batteryLevel);
33void notify_battery_level(const uint8_t batteryLevel);
34
36bool was_used();
37
38// shutdown the bluetooth and services
39void shutdown();
40
41namespace serial {
43bool is_activated();
44
46bool is_available();
47
49char read();
50
52size_t write(const char* const buffer, size_t bufferSize);
53
55uint16_t mtu_size();
56
57} // namespace serial
58
59} // namespace bluetooth
60} // namespace hal
61} // namespace lampda
62
63#endif
void shutdown()
call on program stop to gracefully shutdown the component.
Definition: charging_ic.cpp:688
bool is_advertising()
Return true is the bluetooth is visible by other devices.
Definition: bluetooth.cpp:216
bool was_used()
Return tue if the bluetooth was used during lifetime.
Definition: bluetooth.cpp:264
bool is_connected()
Return true if a bluetooth user is connected.
Definition: bluetooth.cpp:218
bool is_activated()
Return true if the bluetooth is activated.
Definition: bluetooth.cpp:214
Program scope.
Definition: control_fixed_modes.hpp:12
Handle user text inputs.