add BLE::gattServer()

This commit is contained in:
Rohit Grover 2015-06-18 14:49:33 +01:00
parent 68683f1c43
commit 42aaf6bb99
2 changed files with 19 additions and 7 deletions

View file

@ -30,13 +30,14 @@ class GattClient;
class BLEInstanceBase
{
public:
virtual ble_error_t init(void) = 0;
virtual ble_error_t shutdown(void) = 0;
virtual const char *getVersion(void) = 0;
virtual Gap& getGap() = 0;
virtual const Gap& getGap() const = 0;
virtual GattServer& getGattServer() = 0;
virtual GattClient& getGattClient() = 0;
virtual ble_error_t init(void) = 0;
virtual ble_error_t shutdown(void) = 0;
virtual const char *getVersion(void) = 0;
virtual Gap& getGap() = 0;
virtual const Gap& getGap() const = 0;
virtual GattServer& getGattServer() = 0;
virtual const GattServer& getGattServer() const = 0;
virtual GattClient& getGattClient() = 0;
virtual ble_error_t initializeSecurity(bool enableBonding = true,
bool requireMITM = true,
Gap::SecurityIOCapabilities_t iocaps = Gap::IO_CAPS_NONE,

View file

@ -74,6 +74,17 @@ public:
return transport->getGap();
}
/*
* Accessors to GATT Server. Please refer to GattServer.h. All GATTServer related
* functionality requires going through this accessor.
*/
const GattServer& gattServer() const {
return transport->getGattServer();
}
GattServer& gattServer() {
return transport->getGattServer();
}
/**
* Yield control to the BLE stack or to other tasks waiting for events. This
* is a sleep function which will return when there is an application