File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -184,15 +184,15 @@ String BLEDevice::advertisedServiceUuid(int index) const
184
184
return serviceUuid;
185
185
}
186
186
187
- int BLEDevice::advertisementData (uint8_t value[], int length)
187
+ int BLEDevice::advertisementData (uint8_t value[], int length) const
188
188
{
189
- if (_eirDataLength > length) return 0 ; // Check that buffer size is sufficient
189
+ if (length > _eirDataLength) length = _eirDataLength;
190
190
191
- if (_eirDataLength ) {
192
- memcpy (value, _eirData, _eirDataLength );
191
+ if (length ) {
192
+ memcpy (value, _eirData, length );
193
193
}
194
194
195
- return _eirDataLength ;
195
+ return length ;
196
196
}
197
197
198
198
int BLEDevice::rssi ()
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class BLEDevice {
59
59
String advertisedServiceUuid () const ;
60
60
String advertisedServiceUuid (int index) const ;
61
61
62
- int advertisementData (uint8_t value[], int length);
62
+ int advertisementData (uint8_t value[], int length) const ;
63
63
64
64
virtual int rssi ();
65
65
You can’t perform that action at this time.
0 commit comments