High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 584:ac9f89a85d28, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:52:50 2015 +0100
- Parent:
- 583:0fc7fd97e040
- Child:
- 585:7a961834f96d
- Commit message:
- Synchronized with git rev 21c86533
Author: Rohit Grover
turn DiscoveredService into a class.
Changed in this revision
public/ServiceDiscovery.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/ServiceDiscovery.h Fri Jun 19 15:52:50 2015 +0100 +++ b/public/ServiceDiscovery.h Fri Jun 19 15:52:50 2015 +0100 @@ -23,16 +23,38 @@ class ServiceDiscovery { public: - /**@brief Structure for holding information about the service and the characteristics found during + /**@brief Type for holding information about the service and the characteristics found during * the discovery process. */ - struct DiscoveredService { - void setup(ShortUUIDBytes_t uuidIn, Gap::Handle_t start, Gap::Handle_t end) { + class DiscoveredService { + public: + void setup(ShortUUIDBytes_t uuidIn, GattAttribute::Handle_t startHandleIn, GattAttribute::Handle_t endHandleIn) { uuid = uuidIn; - startHandle = start; - endHandle = end; + startHandle = startHandleIn; + endHandle = endHandleIn; + } + + public: + const ShortUUIDBytes_t& getShortUUID(void) const { + return uuid; } + const GattAttribute::Handle_t& getStartHandle(void) const { + return startHandle; + } + const GattAttribute::Handle_t& getEndHandle(void) const { + return endHandle; + } + + public: + DiscoveredService() : uuid(0), startHandle(GattAttribute::INVALID_HANDLE), endHandle(GattAttribute::INVALID_HANDLE) { + /* empty */ + } + + private: + DiscoveredService(const DiscoveredService &); + + private: ShortUUIDBytes_t uuid; /**< UUID of the service. */ GattAttribute::Handle_t startHandle; /**< Service Handle Range. */ GattAttribute::Handle_t endHandle; /**< Service Handle Range. */