Singleton container of all the active connections.
More...
#include <Connection.hxx>
Singleton container of all the active connections.
Definition at line 96 of file Connection.hxx.
◆ Connections()
| ble::Connections::Connections |
( |
| ) |
|
|
inline |
◆ disconnect() [1/2]
| void ble::Connections::disconnect |
( |
Connection * |
conn | ) |
|
|
inline |
Called when a connection is disconnected.
Results in the connection being unregistered.
- Parameters
-
| conn | connection to disconnect |
Definition at line 126 of file Connection.hxx.
◆ disconnect() [2/2]
Called when a connection is disconnected.
Results in the connection being unregistered.
- Parameters
-
| handle | handle belonging to connection to disconnect |
Definition at line 148 of file Connection.hxx.
◆ get_active_count()
| size_t ble::Connections::get_active_count |
( |
| ) |
|
|
inline |
Get the number of active connections being tracked by this object.
- Returns
- number of active connections
Definition at line 203 of file Connection.hxx.
◆ lookup_by_address()
Find a connection by its peer address.
- Parameters
-
| addr | peer address |
| addr_type | peer address type |
- Returns
- connection instance pointer, else nullptr if not found
Definition at line 171 of file Connection.hxx.
◆ lookup_by_handle()
Find a connection by its connection handle.
- Parameters
-
- Returns
- connection instance pointer, else nullptr if not found
Definition at line 188 of file Connection.hxx.
◆ register_connection()
Register an active connection.
- Parameters
-
| handle | handle to the connection |
| addr | peer address |
| addr_type | peer address type |
| central | true if central role, else peripheral role |
Definition at line 109 of file Connection.hxx.
◆ register_disconnect_callback()
| void ble::Connections::register_disconnect_callback |
( |
std::function< void(Connection *connection)> |
callback | ) |
|
|
inline |
Register a callback at disconnection.
- Parameters
-
| callback | callback to call at disconnection |
Definition at line 117 of file Connection.hxx.
◆ callbacks_
| std::vector<std::function<void(Connection *connection)> > ble::Connections::callbacks_ |
|
private |
Callbacks to be called upon disconnection.
Definition at line 212 of file Connection.hxx.
◆ connections_
| std::vector<Connection> ble::Connections::connections_ |
|
private |
All the connections managed by the container.
Definition at line 210 of file Connection.hxx.
The documentation for this class was generated from the following file: