clean up
This commit is contained in:
1 parent
41dd885972
commit
cce9aa990b
6 files changed
+9
-18
No files matched your search
@@ -57,7 +57,7 @@ class BLECentral
|
||||
bool connect(const ble_gap_addr_t *peer_addr);
|
||||
|
||||
bool connected(uint16_t conn_hdl); // Connected as central to this connection
|
||||
uint8_t connected(void); // Number of connected Peripherals
|
||||
uint8_t connected(void); // Number of connected as central
|
||||
|
||||
void clearBonds (void);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ BLEConnection::BLEConnection(uint16_t conn_hdl, ble_gap_evt_connected_t const* e
|
||||
|
||||
_mtu = BLE_GATT_ATT_MTU_DEFAULT;
|
||||
_conn_interval = 0;
|
||||
_addr = evt_connected->peer_addr;
|
||||
_peer_addr = evt_connected->peer_addr;
|
||||
_role = evt_connected->role;
|
||||
|
||||
_hvn_sem = xSemaphoreCreateCounting(hvn_qsize, hvn_qsize);
|
||||
@@ -101,7 +101,7 @@ uint16_t BLEConnection::getConnInterval(void)
|
||||
|
||||
ble_gap_addr_t BLEConnection::getPeerAddr (void)
|
||||
{
|
||||
return _addr;
|
||||
return _peer_addr;
|
||||
}
|
||||
|
||||
static inline bool is_tx_power_valid(int8_t power)
|
||||
@@ -197,7 +197,7 @@ bool BLEConnection::requestPairing(void)
|
||||
|
||||
// Check to see if we did bonded with current prph previously
|
||||
// TODO currently only matches key using fixed address
|
||||
if ( bond_find_cntr(&_addr, &bkeys) )
|
||||
if ( bond_find_cntr(&_peer_addr, &bkeys) )
|
||||
{
|
||||
cntr_ediv = bkeys.peer_enc.master_id.ediv;
|
||||
LOG_LV2("BOND", "Load Keys from file " BOND_FNAME_CNTR, cntr_ediv);
|
||||
|
||||
@@ -54,7 +54,7 @@ class BLEConnection
|
||||
bool _paired;
|
||||
bool _hvc_received;
|
||||
|
||||
ble_gap_addr_t _addr;
|
||||
ble_gap_addr_t _peer_addr;
|
||||
|
||||
SemaphoreHandle_t _hvn_sem;
|
||||
SemaphoreHandle_t _wrcmd_sem;
|
||||
|
||||
@@ -48,7 +48,7 @@ class BLEPeriph
|
||||
bool begin(void);
|
||||
|
||||
bool connected(uint16_t conn_hdl); // Connected as prph to this connection
|
||||
uint8_t connected(void); // Number of connected central
|
||||
uint8_t connected(void); // Number of connected as peripherals
|
||||
|
||||
bool setConnInterval (uint16_t min, uint16_t max);
|
||||
bool setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);
|
||||
|
||||
@@ -627,12 +627,6 @@ bool AdafruitBluefruit::connPaired(void)
|
||||
return conn && conn->paired();
|
||||
}
|
||||
|
||||
ble_gap_addr_t AdafruitBluefruit::getPeerAddr(uint16_t conn_hdl)
|
||||
{
|
||||
BLEConnection* conn = this->Connection(conn_hdl);
|
||||
return conn ? conn->getPeerAddr() : ((ble_gap_addr_t) {0});
|
||||
}
|
||||
|
||||
uint16_t AdafruitBluefruit::getMaxMtu(uint8_t role)
|
||||
{
|
||||
return (role == BLE_GAP_ROLE_PERIPH) ? _sd_cfg.prph.mtu_max : _sd_cfg.central.mtu_max;
|
||||
|
||||
@@ -163,24 +163,22 @@ class AdafruitBluefruit
|
||||
void autoConnLed (bool enabled);
|
||||
void setConnLedInterval (uint32_t ms);
|
||||
|
||||
void clearBonds (void);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* GAP, Connections and Bonding
|
||||
*------------------------------------------------------------------*/
|
||||
uint8_t connected (void); // Number of connected
|
||||
bool connected (uint16_t conn_hdl);
|
||||
|
||||
uint16_t connHandle (void);
|
||||
bool connPaired (void);
|
||||
|
||||
void clearBonds (void);
|
||||
|
||||
// Alias to BLEConnection API()
|
||||
bool connected (uint16_t conn_hdl);
|
||||
bool disconnect (uint16_t conn_hdl);
|
||||
ble_gap_addr_t getPeerAddr (uint16_t conn_hdl);
|
||||
bool requestPairing (uint16_t conn_hdl);
|
||||
|
||||
uint16_t getPeerName (uint16_t conn_hdl, char* buf, uint16_t bufsize);
|
||||
|
||||
uint16_t getMaxMtu(uint8_t role);
|
||||
|
||||
BLEConnection* Connection(uint16_t conn_hdl);
|
||||
@@ -234,7 +232,6 @@ class AdafruitBluefruit
|
||||
bool _led_conn;
|
||||
|
||||
bool _ota_en;
|
||||
|
||||
BLEDfu _dfu_svc;
|
||||
|
||||
uint16_t _conn_hdl;
|
||||
|
||||
Reference in new issue
Block a user