18#ifndef NIMBLECONNINFO_H_
19#define NIMBLECONNINFO_H_
21#if defined(CONFIG_NIMBLE_CPP_IDF)
22# include "host/ble_gap.h"
24# include "nimble/nimble/host/include/host/ble_gap.h"
27#include "NimBLEAddress.h"
53 uint16_t
getMTU()
const {
return ble_att_mtu(m_desc.conn_handle); }
56 bool isMaster()
const {
return (m_desc.role == BLE_GAP_ROLE_MASTER); }
59 bool isSlave()
const {
return (m_desc.role == BLE_GAP_ROLE_SLAVE); }
62 bool isBonded()
const {
return (m_desc.sec_state.bonded == 1); }
65 bool isEncrypted()
const {
return (m_desc.sec_state.encrypted == 1); }
79 ble_gap_conn_desc m_desc{};
A BLE device address.
Definition NimBLEAddress.h:41
The model of a BLE Characteristic.
Definition NimBLECharacteristic.h:40
A model of a BLE client.
Definition NimBLEClient.h:49
Connection information.
Definition NimBLEConnInfo.h:32
uint16_t getConnLatency() const
Gets the allowable latency for this connection (unit = number of intervals)
Definition NimBLEConnInfo.h:50
NimBLEAddress getAddress() const
Gets the over-the-air address of the connected peer.
Definition NimBLEConnInfo.h:35
uint16_t getMTU() const
Gets the maximum transmission unit size for this connection (in bytes)
Definition NimBLEConnInfo.h:53
NimBLEAddress getIdAddress() const
Gets the ID address of the connected peer.
Definition NimBLEConnInfo.h:38
bool isEncrypted() const
Check if the connection in encrypted.
Definition NimBLEConnInfo.h:65
uint8_t getSecKeySize() const
Gets the key size used to encrypt the connection.
Definition NimBLEConnInfo.h:71
bool isMaster() const
Check if we are in the master role in this connection.
Definition NimBLEConnInfo.h:56
bool isAuthenticated() const
Check if the the connection has been authenticated.
Definition NimBLEConnInfo.h:68
uint16_t getConnHandle() const
Gets the connection handle (also known as the connection id) of the connected peer.
Definition NimBLEConnInfo.h:41
uint16_t getConnTimeout() const
Gets the supervision timeout for this connection (in 10ms units)
Definition NimBLEConnInfo.h:47
uint16_t getConnInterval() const
Gets the connection interval for this connection (in 1.25ms units)
Definition NimBLEConnInfo.h:44
bool isSlave() const
Check if we are in the slave role in this connection.
Definition NimBLEConnInfo.h:59
bool isBonded() const
Check if we are connected to a bonded peer.
Definition NimBLEConnInfo.h:62
A model of a BLE descriptor.
Definition NimBLEDescriptor.h:38
The model of a BLE server.
Definition NimBLEServer.h:60