Skip to content

Commit 1836856

Browse files
committed
Enable some confirmed APIs
1. Enable buffer advertisment from peripheral 2. Enable ADV's RSSI 3. Enable scan without parameter
1 parent e916136 commit 1836856

File tree

4 files changed

+418
-51
lines changed

4 files changed

+418
-51
lines changed

libraries/BLE/src/BLEDevice.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ bool BLEDevice::operator!=(const BLEDevice& device) const
212212
}
213213

214214

215+
void BLEDevice::startScanning()
216+
{
217+
preCheckProfile();
218+
BLEDeviceManager::instance()->clearAdvertiseCritical();
219+
BLEDeviceManager::instance()->startScanning();
220+
}
221+
215222
void BLEDevice::startScanning(String name)
216223
{
217224
preCheckProfile();
@@ -243,42 +250,42 @@ BLEDevice BLEDevice::available()
243250

244251
bool BLEDevice::hasLocalName() const
245252
{
246-
return BLEDeviceManager::instance()->hasLocalName();
253+
return BLEDeviceManager::instance()->hasLocalName(this);
247254
}
248255

249256
bool BLEDevice::hasAdvertisedServiceUuid() const
250257
{
251-
return BLEDeviceManager::instance()->hasAdvertisedServiceUuid();
258+
return BLEDeviceManager::instance()->hasAdvertisedServiceUuid(this);
252259
}
253260

254261
bool BLEDevice::hasAdvertisedServiceUuid(int index) const
255262
{
256-
return BLEDeviceManager::instance()->hasAdvertisedServiceUuid(index);
263+
return BLEDeviceManager::instance()->hasAdvertisedServiceUuid(this, index);
257264
}
258265

259266
int BLEDevice::advertisedServiceUuidCount() const
260267
{
261-
return BLEDeviceManager::instance()->advertisedServiceUuidCount();
268+
return BLEDeviceManager::instance()->advertisedServiceUuidCount(this);
262269
}
263270

264271
String BLEDevice::localName() const
265272
{
266-
return BLEDeviceManager::instance()->localName();
273+
return BLEDeviceManager::instance()->localName(this);
267274
}
268275

269276
String BLEDevice::advertisedServiceUuid() const
270277
{
271-
return BLEDeviceManager::instance()->advertisedServiceUuid();
278+
return BLEDeviceManager::instance()->advertisedServiceUuid(this);
272279
}
273280

274281
String BLEDevice::advertisedServiceUuid(int index) const
275282
{
276-
return BLEDeviceManager::instance()->advertisedServiceUuid(index);
283+
return BLEDeviceManager::instance()->advertisedServiceUuid(this, index);
277284
}
278285

279286
int BLEDevice::rssi() const
280287
{
281-
return BLEDeviceManager::instance()->rssi();
288+
return BLEDeviceManager::instance()->rssi(this);
282289
}
283290

284291
bool BLEDevice::connect()

libraries/BLE/src/BLEDevice.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,17 @@ class BLEDevice
351351
bool operator!=(const BLEDevice& device) const;
352352

353353
// central mode
354+
/**
355+
* @brief Start scanning for peripherals without filter
356+
*
357+
* @param none
358+
*
359+
* @return none
360+
*
361+
* @note none
362+
*/
363+
void startScanning();
364+
354365
/**
355366
* @brief Start scanning for peripherals and filter by device name in ADV
356367
*
@@ -606,6 +617,7 @@ class BLEDevice
606617
const bt_addr_le_t* bt_le_address() const;
607618
const bt_le_conn_param* bt_conn_param() const;
608619
void setAddress(const bt_addr_le_t& addr);
620+
void setAdvertiseData(const uint8_t* adv_data, uint8_t len);
609621
private:
610622
void preCheckProfile();
611623

0 commit comments

Comments
 (0)