Skip to content

Commit

Permalink
- make iBeacon extend BLEPeripheral
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepmistry committed Jun 4, 2015
1 parent 2e5a8d4 commit ef8ede4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 5 additions & 5 deletions iBeacon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
5 changes: 1 addition & 4 deletions iBeacon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef8ede4

Please sign in to comment.