Skip to content

Commit a5fea56

Browse files
committed
clean up
1 parent 44a98b6 commit a5fea56

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

libraries/Bluefruit52Lib/src/BLEPeriph.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,19 @@ void BLEPeriph::setDisconnectCallback( ble_disconnect_callback_t fp )
126126
void BLEPeriph::_eventHandler(ble_evt_t* evt)
127127
{
128128
uint16_t const conn_hdl = evt->evt.common_evt.conn_handle;
129+
BLEConnection* conn = Bluefruit.Connection(conn_hdl);
129130

130131
switch ( evt->header.evt_id )
131132
{
132133
case BLE_GAP_EVT_CONNECTED:
133134
{
134135
ble_gap_evt_connected_t* para = &evt->evt.gap_evt.params.connected;
135136

136-
if (para->role == BLE_GAP_ROLE_PERIPH)
137+
// Connection interval set by Central is out of preferred range
138+
// Try to negotiate with Central using our preferred values
139+
if ( !is_within(_ppcp.min_conn_interval, para->conn_params.min_conn_interval, _ppcp.max_conn_interval) )
137140
{
138-
// Connection interval set by Central is out of preferred range
139-
// Try to negotiate with Central using our preferred values
140-
if ( !is_within(_ppcp.min_conn_interval, para->conn_params.min_conn_interval, _ppcp.max_conn_interval) )
141-
{
142-
VERIFY_STATUS( sd_ble_gap_conn_param_update(conn_hdl, &_ppcp), );
143-
}
141+
VERIFY_STATUS( sd_ble_gap_conn_param_update(conn_hdl, &_ppcp), );
144142
}
145143
}
146144
break;

0 commit comments

Comments
 (0)