Skip to content

Commit 6f1acc4

Browse files
committed
Fixed a bug that disconnect function of client characteristics was not called.
1 parent 37e3b53 commit 6f1acc4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libraries/Bluefruit52Lib/src/BLEGatt.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,20 @@ void BLEGatt::_eventHandler(ble_evt_t* evt)
184184
if ( evt_id == BLE_GAP_EVT_DISCONNECTED )
185185
{
186186
// Client
187-
for(uint8_t i=0; i<_client.svc_count; i++)
187+
for(uint8_t i=0; i<_client.chr_count; i++)
188188
{
189-
if ( evt_conn_hdl == _client.svc_list[i]->_conn_hdl)
189+
if ( evt_conn_hdl == _client.chr_list[i]->connHandle() )
190190
{
191-
_client.svc_list[i]->disconnect();
191+
_client.chr_list[i]->disconnect();
192192
}
193193
}
194194

195195
// TODO merge to above loop
196-
for(uint8_t i=0; i<_client.chr_count; i++)
196+
for(uint8_t i=0; i<_client.svc_count; i++)
197197
{
198-
if ( evt_conn_hdl == _client.chr_list[i]->connHandle() )
198+
if ( evt_conn_hdl == _client.svc_list[i]->_conn_hdl)
199199
{
200-
_client.chr_list[i]->disconnect();
200+
_client.svc_list[i]->disconnect();
201201
}
202202
}
203203
}

0 commit comments

Comments
 (0)