Skip to content

Commit 215641c

Browse files
sgbihuSidLeung
authored andcommitted
Jira 836, Enumerate non connectable Peripherals in Central scan …
Added feature: - In Central mode, the BLE library should enumerate Peripheral that are non-connectable (eg beacon). Code Mods: 1. BLEDevice.cpp: - Add the call to get Manufacturer Data info from a Peripheral. Non-connectable device may only broadcast this info. 2. BLEDevice.h: - Prototyping. 3. BLEDeviceManager.cpp: - Delete the filter about non-connectable advertisement. - Added APIs, hasManufacturerData(), setManufacturerData(), hasManufacturerData(), to gain access to adv info of non-connectable Peripherals.
1 parent d818a3a commit 215641c

File tree

4 files changed

+566
-224
lines changed

4 files changed

+566
-224
lines changed

libraries/CurieBLE/src/BLEDevice.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ void BLEDevice::setManufacturerData(const unsigned char manufacturerData[],
133133
BLEDeviceManager::instance()->setManufacturerData(manufacturerData, manufacturerDataLength);
134134
}
135135

136+
bool BLEDevice::getManufacturerData (unsigned char* manu_data,
137+
unsigned char& manu_data_len) const
138+
{
139+
return BLEDeviceManager::instance()->getManufacturerData(this, manu_data, manu_data_len);
140+
}
141+
142+
bool BLEDevice::hasManufacturerData() const
143+
{
144+
return BLEDeviceManager::instance()->hasManufacturerData(this);
145+
}
146+
136147
void BLEDevice::setLocalName(const char *localName)
137148
{
138149
BLEDeviceManager::instance()->setLocalName(localName);

libraries/CurieBLE/src/BLEDevice.h

+5
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ class BLEDevice
191191
void setManufacturerData(const unsigned char manufacturerData[],
192192
unsigned char manufacturerDataLength);
193193

194+
bool getManufacturerData (unsigned char* manu_data,
195+
unsigned char& manu_data_len) const;
196+
197+
bool hasManufacturerData() const;
198+
194199
/**
195200
* Set the local name that the BLE Peripheral Device advertises
196201
*

0 commit comments

Comments
 (0)