Skip to content

Commit

Permalink
Add advertisement data auxiliary functions
Browse files Browse the repository at this point in the history
  • Loading branch information
polldo committed Apr 20, 2021
1 parent a9550cf commit bd492be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/BLEDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ String BLEDevice::advertisedServiceUuid(int index) const
return serviceUuid;
}

bool BLEDevice::hasAdvertisementData() const
{
return (_eirDataLength > 0);
}

int BLEDevice::advertisementDataLength() const
{
return _eirDataLength;
}

int BLEDevice::advertisementData(uint8_t value[], int length) const
{
if (length > _eirDataLength) length = _eirDataLength;
Expand Down
2 changes: 2 additions & 0 deletions src/BLEDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class BLEDevice {
String advertisedServiceUuid() const;
String advertisedServiceUuid(int index) const;

bool hasAdvertisementData() const;
int advertisementDataLength() const;
int advertisementData(uint8_t value[], int length) const;

virtual int rssi();
Expand Down

0 comments on commit bd492be

Please sign in to comment.