Adding BLEClientDis
- add get/set HandleRange for BLEDiscovery - implement destructor for BLEClientCharacteristic - add BLEGatt::_removeCharacteristic(client) -
This commit is contained in:
1 parent
f72401271e
commit
ae20fa0176
12 files changed
+90
-16
No files matched your search
@@ -60,6 +60,29 @@ BLEClientCharacteristic::BLEClientCharacteristic(BLEUuid bleuuid)
|
||||
_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
BLEClientCharacteristic::~BLEClientCharacteristic()
|
||||
{
|
||||
_adamsg.stop();
|
||||
Bluefruit.Gatt._removeCharacteristic(this);
|
||||
}
|
||||
|
||||
void BLEClientCharacteristic::begin(BLEClientService* parent_svc)
|
||||
{
|
||||
// Add UUID128 if needed
|
||||
uuid.begin();
|
||||
|
||||
// Use the last (discovered) service as parent if not provided
|
||||
_service = ( parent_svc == NULL ) ? BLEClientService::lastService : parent_svc;
|
||||
|
||||
// Register to Bluefruit (required for callback and write response)
|
||||
(void) Bluefruit.Gatt._addCharacteristic(this);
|
||||
|
||||
_adamsg.begin(true);
|
||||
}
|
||||
|
||||
void BLEClientCharacteristic::assign(ble_gattc_char_t* gattc_chr)
|
||||
{
|
||||
_chr = *gattc_chr;
|
||||
@@ -110,19 +133,6 @@ bool BLEClientCharacteristic::discoverDescriptor(uint16_t conn_handle)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BLEClientCharacteristic::begin(void)
|
||||
{
|
||||
// Add UUID128 if needed
|
||||
uuid.begin();
|
||||
|
||||
_service = BLEClientService::lastService;
|
||||
|
||||
// Register to Bluefruit (required for callback and write response)
|
||||
(void) Bluefruit.Gatt._addCharacteristic(this);
|
||||
|
||||
_adamsg.begin(true);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* READ
|
||||
*------------------------------------------------------------------*/
|
||||
|
||||
Reference in new issue
Block a user