File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,20 @@ class GapAdvertisingData
357
357
* Where the first element is the length of the field.
358
358
*/
359
359
const uint8_t * findField (DataType_t type) const {
360
- return findField (type);
360
+ /* Scan through advertisement data */
361
+ for (uint8_t idx = 0 ; idx < _payloadLen; ) {
362
+ uint8_t fieldType = _payload[idx + 1 ];
363
+
364
+ if (fieldType == type) {
365
+ return &_payload[idx];
366
+ }
367
+
368
+ /* Advance to next field */
369
+ idx += _payload[idx] + 1 ;
370
+ }
371
+
372
+ /* Field not found */
373
+ return NULL ;
361
374
}
362
375
363
376
private:
@@ -408,20 +421,7 @@ class GapAdvertisingData
408
421
* otherwise. Where the first element is the length of the field.
409
422
*/
410
423
uint8_t * findField (DataType_t type) {
411
- /* Scan through advertisement data */
412
- for (uint8_t idx = 0 ; idx < _payloadLen; ) {
413
- uint8_t fieldType = _payload[idx + 1 ];
414
-
415
- if (fieldType == type) {
416
- return &_payload[idx];
417
- }
418
-
419
- /* Advance to next field */
420
- idx += _payload[idx] + 1 ;
421
- }
422
-
423
- /* Field not found */
424
- return NULL ;
424
+ return const_cast <uint8_t *>(static_cast <const GapAdvertisingData*>(this )->findField (type));
425
425
}
426
426
427
427
/* *
You can’t perform that action at this time.
0 commit comments