[central] add connHandle()

This commit is contained in:
hathach committed 2017-03-22 22:13:33 +07:00
1 parent 5751d6f651
commit bba444f0b4
2 files changed
+8 -2

No files matched your search

+6 -1
View File
@@ -192,6 +192,11 @@ bool BLECentral::connected(void)
return (_conn_hdl != BLE_CONN_HANDLE_INVALID);
}
uint16_t BLECentral::connHandle (void)
{
return _conn_hdl;
}
void BLECentral::setConnectCallback( connect_callback_t fp)
{
_connect_cb = fp;
@@ -288,7 +293,7 @@ uint16_t BLECentral::_discoverDescriptor(ble_gattc_evt_desc_disc_rsp_t* disc_des
// increase handle range for next discovery
// should be +1 more, but that will cause missing on the next Characteristic !!!!!
// Reason is descriptor also include BLE_UUID_CHARACTERISTIC 0x2803 in the result
// Reason is descriptor also include BLE_UUID_CHARACTERISTIC 0x2803 (Char declaration) in the result
_disc_hdl_range.start_handle = disc_desc->descs[result-1].handle;
}
+2 -1
View File
@@ -80,7 +80,8 @@ class BLECentral
uint16_t min_conn_interval = BLE_GAP_CONN_MIN_INTERVAL_DFLT,
uint16_t max_conn_interval = BLE_GAP_CONN_MAX_INTERVAL_DFLT);
bool connected(void);
bool connected (void);
uint16_t connHandle (void);
/*------------------------------------------------------------------*/
/* GATTC Discovery