From ef8ede4a49984d4a74dc452945fad4f428fa1878 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Thu, 4 Jun 2015 15:26:16 -0400 Subject: [PATCH] - make iBeacon extend BLEPeripheral --- iBeacon.cpp | 10 +++++----- iBeacon.h | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/iBeacon.cpp b/iBeacon.cpp index 4cc0e9d..0a6e92d 100644 --- a/iBeacon.cpp +++ b/iBeacon.cpp @@ -5,9 +5,9 @@ #include "iBeacon.h" iBeacon::iBeacon() : - _blePeripheral(0, 0, 0) + BLEPeripheral(0, 0, 0) { - this->_blePeripheral.setConnectable(false); + this->setConnectable(false); } void iBeacon::begin(const char* uuidString, unsigned short major, unsigned short minor, char measuredPower) { @@ -33,13 +33,13 @@ void iBeacon::begin(const char* uuidString, unsigned short major, unsigned short manufacturerData[i++] = minor; manufacturerData[i++] = measuredPower; - this->_blePeripheral.setManufacturerData(manufacturerData, i); + this->setManufacturerData(manufacturerData, i); - this->_blePeripheral.begin(); + BLEPeripheral::begin(); } void iBeacon::loop() { - this->_blePeripheral.poll(); + this->poll(); } #endif diff --git a/iBeacon.h b/iBeacon.h index d28b199..8c80724 100644 --- a/iBeacon.h +++ b/iBeacon.h @@ -5,16 +5,13 @@ #include "BLEPeripheral.h" -class iBeacon +class iBeacon : public BLEPeripheral { public: iBeacon(); void begin(const char* uuidString, unsigned short major, unsigned short minor, char measuredPower); void loop(); - - private: - BLEPeripheral _blePeripheral; }; #endif