Skip to content

Commit cce9aa9

Browse files
committed
clean up
1 parent 41dd885 commit cce9aa9

File tree

6 files changed

+9
-18
lines changed

6 files changed

+9
-18
lines changed

libraries/Bluefruit52Lib/src/BLECentral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class BLECentral
5757
bool connect(const ble_gap_addr_t *peer_addr);
5858

5959
bool connected(uint16_t conn_hdl); // Connected as central to this connection
60-
uint8_t connected(void); // Number of connected Peripherals
60+
uint8_t connected(void); // Number of connected as central
6161

6262
void clearBonds (void);
6363

libraries/Bluefruit52Lib/src/BLEConnection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ BLEConnection::BLEConnection(uint16_t conn_hdl, ble_gap_evt_connected_t const* e
4747

4848
_mtu = BLE_GATT_ATT_MTU_DEFAULT;
4949
_conn_interval = 0;
50-
_addr = evt_connected->peer_addr;
50+
_peer_addr = evt_connected->peer_addr;
5151
_role = evt_connected->role;
5252

5353
_hvn_sem = xSemaphoreCreateCounting(hvn_qsize, hvn_qsize);
@@ -101,7 +101,7 @@ uint16_t BLEConnection::getConnInterval(void)
101101

102102
ble_gap_addr_t BLEConnection::getPeerAddr (void)
103103
{
104-
return _addr;
104+
return _peer_addr;
105105
}
106106

107107
static inline bool is_tx_power_valid(int8_t power)
@@ -197,7 +197,7 @@ bool BLEConnection::requestPairing(void)
197197

198198
// Check to see if we did bonded with current prph previously
199199
// TODO currently only matches key using fixed address
200-
if ( bond_find_cntr(&_addr, &bkeys) )
200+
if ( bond_find_cntr(&_peer_addr, &bkeys) )
201201
{
202202
cntr_ediv = bkeys.peer_enc.master_id.ediv;
203203
LOG_LV2("BOND", "Load Keys from file " BOND_FNAME_CNTR, cntr_ediv);

libraries/Bluefruit52Lib/src/BLEConnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BLEConnection
5454
bool _paired;
5555
bool _hvc_received;
5656

57-
ble_gap_addr_t _addr;
57+
ble_gap_addr_t _peer_addr;
5858

5959
SemaphoreHandle_t _hvn_sem;
6060
SemaphoreHandle_t _wrcmd_sem;

libraries/Bluefruit52Lib/src/BLEPeriph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class BLEPeriph
4848
bool begin(void);
4949

5050
bool connected(uint16_t conn_hdl); // Connected as prph to this connection
51-
uint8_t connected(void); // Number of connected central
51+
uint8_t connected(void); // Number of connected as peripherals
5252

5353
bool setConnInterval (uint16_t min, uint16_t max);
5454
bool setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,6 @@ bool AdafruitBluefruit::connPaired(void)
627627
return conn && conn->paired();
628628
}
629629

630-
ble_gap_addr_t AdafruitBluefruit::getPeerAddr(uint16_t conn_hdl)
631-
{
632-
BLEConnection* conn = this->Connection(conn_hdl);
633-
return conn ? conn->getPeerAddr() : ((ble_gap_addr_t) {0});
634-
}
635-
636630
uint16_t AdafruitBluefruit::getMaxMtu(uint8_t role)
637631
{
638632
return (role == BLE_GAP_ROLE_PERIPH) ? _sd_cfg.prph.mtu_max : _sd_cfg.central.mtu_max;

libraries/Bluefruit52Lib/src/bluefruit.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,22 @@ class AdafruitBluefruit
163163
void autoConnLed (bool enabled);
164164
void setConnLedInterval (uint32_t ms);
165165

166+
void clearBonds (void);
167+
166168
/*------------------------------------------------------------------*/
167169
/* GAP, Connections and Bonding
168170
*------------------------------------------------------------------*/
169171
uint8_t connected (void); // Number of connected
172+
bool connected (uint16_t conn_hdl);
170173

171174
uint16_t connHandle (void);
172175
bool connPaired (void);
173176

174-
void clearBonds (void);
175-
176177
// Alias to BLEConnection API()
177-
bool connected (uint16_t conn_hdl);
178178
bool disconnect (uint16_t conn_hdl);
179-
ble_gap_addr_t getPeerAddr (uint16_t conn_hdl);
180179
bool requestPairing (uint16_t conn_hdl);
181180

182181
uint16_t getPeerName (uint16_t conn_hdl, char* buf, uint16_t bufsize);
183-
184182
uint16_t getMaxMtu(uint8_t role);
185183

186184
BLEConnection* Connection(uint16_t conn_hdl);
@@ -234,7 +232,6 @@ class AdafruitBluefruit
234232
bool _led_conn;
235233

236234
bool _ota_en;
237-
238235
BLEDfu _dfu_svc;
239236

240237
uint16_t _conn_hdl;

0 commit comments

Comments
 (0)