Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: public/BLEDevice.h
- Revision:
- 409:37a4202649dd
- Parent:
- 407:ca6b956b33d1
- Child:
- 410:af8f2d1b67b6
--- a/public/BLEDevice.h Mon Jun 08 10:41:17 2015 +0100
+++ b/public/BLEDevice.h Mon Jun 08 10:41:17 2015 +0100
@@ -136,6 +136,12 @@
void setAdvertisingParams(const GapAdvertisingParams &advParams);
/**
+ * @return Read back advertising parameters. Useful for storing and
+ * restoring parameters rapidly.
+ */
+ GapAdvertisingParams getAdvertisingParams(void);
+
+ /**
* This API is typically used as an internal helper to udpate the transport
* backend with advertising data before starting to advertise. It may also
* be explicity used to dynamically reset the accumulated advertising
@@ -146,6 +152,17 @@
ble_error_t setAdvertisingPayload(void);
/**
+ * Set advertising data using object.
+ */
+ ble_error_t setAdvertisingData(const GapAdvertisingData &advData);
+
+ /**
+ * @return Read back advertising data. Useful for storing and
+ * restoring payload.
+ */
+ GapAdvertisingData getAdvertisingData(void);
+
+ /**
* Reset any advertising payload prepared from prior calls to
* accumulateAdvertisingPayload().
*
@@ -679,6 +696,12 @@
advParams = newAdvParams;
}
+inline GapAdvertisingParams
+BLEDevice::getAdvertisingParams(void)
+{
+ return advParams;
+}
+
inline void
BLEDevice::clearAdvertisingPayload(void)
{
@@ -739,6 +762,19 @@
}
inline ble_error_t
+BLEDevice::setAdvertisingData(const GapAdvertisingData& newPayload)
+{
+ advPayload = newPayload;
+
+ return setAdvertisingPayload();
+}
+
+inline GapAdvertisingData
+BLEDevice::getAdvertisingData(void) {
+ return advPayload;
+}
+
+inline ble_error_t
BLEDevice::startAdvertising(void)
{
ble_error_t rc;
