@@ -54,7 +54,7 @@ int GAPClass::advertise(uint8_t* advData, uint8_t advDataLen, uint8_t* scanData,
5454
5555 stopAdvertise ();
5656
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 ) {
5858 return 0 ;
5959 }
6060
@@ -91,8 +91,8 @@ int GAPClass::scan(bool withDuplicates)
9191 }
9292 }
9393
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 ) {
9696 return false ;
9797 }
9898
@@ -270,6 +270,11 @@ bool GAPClass::matchesScanFilter(const BLEDevice& device)
270270 return true ;
271271}
272272
273+ void GAPClass::setOwnBdaddrType (uint8_t ownBdaddrType)
274+ {
275+ _ownBdaddrType = ownBdaddrType;
276+ }
277+
273278#if !defined(FAKE_GAP)
274279GAPClass GAPObj;
275280GAPClass& GAP = GAPObj;
0 commit comments