Skip to content

Commit 8f8fa56

Browse files
sgbihuSidLeung
authored andcommitted
Jira 824, BLE Peripheral to create Scan Response Data
Feature added: - Arduino request that the BLE library, in Peripheral mode, to support Scan Response Data request from a Central. - Arduino expects the reply similar to an Apple device. They have provide a policy for the construction of the Scan Response data message. Code mods: 1. BLEDeviceManager.cpp: - Added setAdvertiseData() for the creation of the Scan Response Data message. - In advDataInit(), follows the policy (defined by Arduino) to add Adv data to the Scan Response Data message using setAdvertiseData(). 2. BLEDeviceManager.h: - prototypeing.
1 parent 59d03ae commit 8f8fa56

File tree

4 files changed

+566
-224
lines changed

4 files changed

+566
-224
lines changed

libraries/CurieBLE/src/BLEDevice.cpp

Lines changed: 11 additions & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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)