client characteristic rename assign, discoverDescriptor for internal ussage
This commit is contained in:
1 parent
ad313ee8db
commit
0003e1af6e
3 files changed
+8
-7
No files matched your search
@@ -81,7 +81,7 @@ void BLEClientCharacteristic::begin(BLEClientService* parent_svc)
|
||||
_adamsg.begin(true);
|
||||
}
|
||||
|
||||
void BLEClientCharacteristic::assign(ble_gattc_char_t* gattc_chr)
|
||||
void BLEClientCharacteristic::_assign(ble_gattc_char_t* gattc_chr)
|
||||
{
|
||||
_chr = *gattc_chr;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ BLEClientService& BLEClientCharacteristic::parentService (void)
|
||||
return *_service;
|
||||
}
|
||||
|
||||
bool BLEClientCharacteristic::discoverDescriptor(uint16_t conn_handle, ble_gattc_handle_range_t hdl_range)
|
||||
bool BLEClientCharacteristic::_discoverDescriptor(uint16_t conn_handle, ble_gattc_handle_range_t hdl_range)
|
||||
{
|
||||
enum { MAX_DESCIRPTORS = 8 };
|
||||
|
||||
|
||||
@@ -59,9 +59,6 @@ class BLEClientCharacteristic
|
||||
// Destructor
|
||||
virtual ~BLEClientCharacteristic();
|
||||
|
||||
void assign(ble_gattc_char_t* gattc_chr);
|
||||
bool discoverDescriptor(uint16_t conn_handle, ble_gattc_handle_range_t hdl_range);
|
||||
|
||||
void begin(BLEClientService* parent_svc = NULL);
|
||||
|
||||
bool discover(void);
|
||||
@@ -97,6 +94,10 @@ class BLEClientCharacteristic
|
||||
void setNotifyCallback(notify_cb_t fp);
|
||||
void useAdaCallback(bool enabled);
|
||||
|
||||
/*------------- Internal usage -------------*/
|
||||
void _assign(ble_gattc_char_t* gattc_chr);
|
||||
bool _discoverDescriptor(uint16_t conn_handle, ble_gattc_handle_range_t hdl_range);
|
||||
|
||||
private:
|
||||
ble_gattc_char_t _chr;
|
||||
uint16_t _cccd_handle;
|
||||
|
||||
@@ -135,7 +135,7 @@ uint8_t BLEDiscovery::discoverCharacteristic(uint16_t conn_handle, BLEClientChar
|
||||
LOG_LV2("DISC", "[CHR] Found 0x%04X, handle = %d\n-----------------", disc_chr->chars[d].uuid.uuid, disc_chr->chars[d].handle_value);
|
||||
|
||||
// characteristic assign overload
|
||||
chr[i]->assign(&disc_chr->chars[d]);
|
||||
chr[i]->_assign(&disc_chr->chars[d]);
|
||||
|
||||
// only discover CCCD descriptor
|
||||
if (disc_chr->chars[d].char_props.notify || disc_chr->chars[d].char_props.indicate )
|
||||
@@ -145,7 +145,7 @@ uint8_t BLEDiscovery::discoverCharacteristic(uint16_t conn_handle, BLEClientChar
|
||||
if ( range.start_handle <= range.end_handle )
|
||||
{
|
||||
// skip if reaching end of range (last char has no descriptor)p
|
||||
chr[i]->discoverDescriptor(conn_handle, range);
|
||||
chr[i]->_discoverDescriptor(conn_handle, range);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user