Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
Diff: source/nRF5xGattServer.h
- Revision:
- 566:e425ad9e5d6e
- Parent:
- 565:cf03471a4ec4
- Child:
- 570:f162898cb6c4
--- a/source/nRF5xGattServer.h Mon Jan 11 10:19:18 2016 +0000 +++ b/source/nRF5xGattServer.h Mon Jan 11 10:19:18 2016 +0000 @@ -27,6 +27,8 @@ class nRF5xGattServer : public GattServer { public: + static nRF5xGattServer &getInstance(); + /* Functions that must be implemented from GattServer */ virtual ble_error_t addService(GattService &); virtual ble_error_t read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP); @@ -35,13 +37,11 @@ virtual ble_error_t write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false); virtual ble_error_t areUpdatesEnabled(const GattCharacteristic &characteristic, bool *enabledP); virtual ble_error_t areUpdatesEnabled(Gap::Handle_t connectionHandle, const GattCharacteristic &characteristic, bool *enabledP); - virtual ble_error_t reset(void); /* nRF51 Functions */ void eventCallback(void); void hwCallback(ble_evt_t *p_ble_evt); - private: const static unsigned BLE_TOTAL_CHARACTERISTICS = 20; const static unsigned BLE_TOTAL_DESCRIPTORS = 8; @@ -86,11 +86,6 @@ uint8_t descriptorCount; uint16_t nrfDescriptorHandles[BLE_TOTAL_DESCRIPTORS]; - /* - * Allow instantiation from nRF5xn when required. - */ - friend class nRF5xn; - nRF5xGattServer() : GattServer(), p_characteristics(), nrfCharacteristicHandles(), p_descriptors(), descriptorCount(0), nrfDescriptorHandles() { /* empty */ }