@@ -54,7 +54,7 @@ int GAPClass::advertise(uint8_t* advData, uint8_t advDataLen, uint8_t* scanData,
54
54
55
55
stopAdvertise ();
56
56
57
- if (HCI.leSetAdvertisingParameters (_advertisingInterval, _advertisingInterval, type, 0x00 , 0x00 , directBdaddr, 0x07 , 0 ) != 0 ) {
57
+ if (HCI.leSetAdvertisingParameters (_advertisingInterval, _advertisingInterval, type, _ownBdaddrType , 0x00 , directBdaddr, 0x07 , 0 ) != 0 ) {
58
58
return 0 ;
59
59
}
60
60
@@ -91,8 +91,8 @@ int GAPClass::scan(bool withDuplicates)
91
91
}
92
92
}
93
93
94
- // active scan, 10 ms scan interval (N * 0.625), 10 ms scan window (N * 0.625), public own address type, no filter
95
- if (HCI.leSetScanParameters (0x01 , 0x0010 , 0x0010 , 0x00 , 0x00 ) != 0 ) {
94
+ // active scan, 10 ms scan interval (N * 0.625), 10 ms scan window (N * 0.625), public or static random own address type, no filter
95
+ if (HCI.leSetScanParameters (0x01 , 0x0010 , 0x0010 , _ownBdaddrType , 0x00 ) != 0 ) {
96
96
return false ;
97
97
}
98
98
@@ -270,6 +270,11 @@ bool GAPClass::matchesScanFilter(const BLEDevice& device)
270
270
return true ;
271
271
}
272
272
273
+ void GAPClass::setOwnBdaddrType (uint8_t ownBdaddrType)
274
+ {
275
+ _ownBdaddrType = ownBdaddrType;
276
+ }
277
+
273
278
#if !defined(FAKE_GAP)
274
279
GAPClass GAPObj;
275
280
GAPClass& GAP = GAPObj;
0 commit comments