Skip to content

Commit bf6ecf0

Browse files
committed
Merge branch 'pr-150'
2 parents 307d280 + 029d781 commit bf6ecf0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/BLEDevice.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ String BLEDevice::advertisedServiceUuid(int index) const
209209
return serviceUuid;
210210
}
211211

212+
int BLEDevice::advertisementData(uint8_t value[], int length)
213+
{
214+
if (_eirDataLength > length) return 0; // Check that buffer size is sufficient
215+
216+
if (_eirDataLength) {
217+
memcpy(value, _eirData, _eirDataLength);
218+
}
219+
220+
return _eirDataLength;
221+
}
222+
212223
int BLEDevice::rssi()
213224
{
214225
uint16_t handle = ATT.connectionHandle(_addressType, _address);

src/BLEDevice.h

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BLEDevice {
6161
String advertisedServiceUuid() const;
6262
String advertisedServiceUuid(int index) const;
6363

64+
int advertisementData(uint8_t value[], int length);
65+
6466
virtual int rssi();
6567

6668
bool connect();

0 commit comments

Comments
 (0)