File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
libraries/Bluefruit52Lib/src Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -126,21 +126,19 @@ void BLEPeriph::setDisconnectCallback( ble_disconnect_callback_t fp )
126
126
void BLEPeriph::_eventHandler (ble_evt_t * evt)
127
127
{
128
128
uint16_t const conn_hdl = evt->evt .common_evt .conn_handle ;
129
+ BLEConnection* conn = Bluefruit.Connection (conn_hdl);
129
130
130
131
switch ( evt->header .evt_id )
131
132
{
132
133
case BLE_GAP_EVT_CONNECTED:
133
134
{
134
135
ble_gap_evt_connected_t * para = &evt->evt .gap_evt .params .connected ;
135
136
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 ) )
137
140
{
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), );
144
142
}
145
143
}
146
144
break ;
You can’t perform that action at this time.
0 commit comments