add bleconnection connected()

This commit is contained in:
hathach committed 2019-01-21 18:16:05 +07:00
1 parent 49ad36cdd6
commit 14980fbe12
5 files changed
+15 -3

No files matched your search

+1 -1
View File
@@ -544,7 +544,7 @@ bool AdafruitBluefruit::connected(void)
bool AdafruitBluefruit::connected(uint16_t conn_hdl)
{
BLEConnection* conn = Gap.getConnection(conn_hdl);
return conn && (conn->getRole() == BLE_GAP_ROLE_PERIPH);
return conn && conn->connected() && (conn->getRole() == BLE_GAP_ROLE_PERIPH);
}
bool AdafruitBluefruit::disconnect(void)