add _disconnect_cb() and _connect_cb() to BLEService

integrate BLEService.addToGatt() to begin()
This commit is contained in:
hathach committed 2017-07-26 11:07:53 +07:00
1 parent ca2d6f3dce
commit 5259a71ebb
9 files changed
+44 -19

No files matched your search

+9 -3
View File
@@ -61,7 +61,7 @@ void BLEService::setUuid(BLEUuid bleuuid)
uuid = bleuuid;
}
err_t BLEService::addToGatt(void)
err_t BLEService::begin(void)
{
// Add UUID128 if needed
uuid.begin();
@@ -70,12 +70,18 @@ err_t BLEService::addToGatt(void)
VERIFY_STATUS( sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &uuid._uuid, &handle) );
lastService = this;
(void) Bluefruit.Gatt._addService(this);
return ERROR_NONE;
}
err_t BLEService::begin(void)
void BLEService::_disconnect_cb(void)
{
return addToGatt();
// Template for inherited class
}
void BLEService::_connect_cb(void)
{
// Template for inherited class
}