Allow BLESerivce to have instance
- remove Bluefruit::addService
This commit is contained in:
1 parent
dd57126e93
commit
046132edf6
4 files changed
+6
-23
No files matched your search
@@ -85,3 +85,8 @@ err_t BLEService::addToGatt(void)
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
err_t BLEService::start(void)
|
||||
{
|
||||
return addToGatt();
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ class BLEService
|
||||
void setUuid(uint16_t uuid16);
|
||||
void setUuid(uint8_t const uuid128[]);
|
||||
|
||||
// Abstract Class
|
||||
virtual err_t start(void) = 0;
|
||||
virtual err_t start(void);
|
||||
};
|
||||
|
||||
#endif /* BLESERVICE_H_ */
|
||||
@@ -449,23 +449,6 @@ void AdafruitBluefruit::stopAdvertising(void)
|
||||
_stopConnLed(); // stop blinking
|
||||
}
|
||||
|
||||
err_t AdafruitBluefruit::addService(uint16_t uuid16)
|
||||
{
|
||||
BLEUuid uuid(uuid16);
|
||||
|
||||
uint16_t svc_handle;
|
||||
return sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &uuid._uuid, &svc_handle);
|
||||
}
|
||||
|
||||
err_t AdafruitBluefruit::addService(uint8_t const uuid128[])
|
||||
{
|
||||
BLEUuid uuid;
|
||||
uuid.set(uuid128);
|
||||
|
||||
uint16_t svc_handle;
|
||||
return sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &uuid._uuid, &svc_handle);
|
||||
}
|
||||
|
||||
err_t AdafruitBluefruit::_registerCharacteristic(BLECharacteristic* chars)
|
||||
{
|
||||
if ( _chars_count == BLE_MAX_CHARS ) return NRF_ERROR_NO_MEM;
|
||||
|
||||
@@ -106,10 +106,6 @@ class AdafruitBluefruit
|
||||
/*------------------------------------------------------------------*/
|
||||
/*
|
||||
*------------------------------------------------------------------*/
|
||||
// Add service without using BLEService instance
|
||||
err_t addService(uint16_t uuid16);
|
||||
err_t addService(uint8_t const uuid128[]);
|
||||
|
||||
void disconnect(void);
|
||||
bool connected(void);
|
||||
|
||||
|
||||
Reference in new issue
Block a user