minor clean up

This commit is contained in:
hathach committed 2017-07-11 18:12:57 +07:00
1 parent 80683cfafe
commit 9c7870580c
3 files changed
+14 -14

No files matched your search

+10 -10
View File
@@ -49,25 +49,25 @@ bool BLEGap::connected(uint16_t conn_handle)
return _peers[conn_handle].connected;
}
void BLEGap::setConnectCallback(connect_callback_t fp, bool isCentral)
void BLEGap::setConnectCallback(connect_callback_t fp, uint8_t role)
{
if (isCentral)
{
_central_cb.connect_cb = fp;
}else
if (role == BLE_GAP_ROLE_PERIPH)
{
_prph_cb.connect_cb = fp;
}else
{
_central_cb.connect_cb = fp;
}
}
void BLEGap::setDisconnectCallback(disconnect_callback_t fp, bool isCentral)
void BLEGap::setDisconnectCallback(disconnect_callback_t fp, uint8_t role)
{
if (isCentral)
{
_central_cb.disconnect_cb = fp;
}else
if (role == BLE_GAP_ROLE_PERIPH)
{
_prph_cb.disconnect_cb = fp;
}else
{
_central_cb.disconnect_cb = fp;
}
}