High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 183:41d6ffadba96, committed 2014-11-28
- Comitter:
- rgrover1
- Date:
- Fri Nov 28 14:11:23 2014 +0000
- Parent:
- 182:d16f8c11816b
- Child:
- 184:ec211f2288ef
- Commit message:
- Synchronized with git rev 09a38f1e
Author: Rohit Grover
comment headers and minor white space diffs.
Changed in this revision
services/URIBeacon2Service.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/services/URIBeacon2Service.h Fri Nov 28 14:11:23 2014 +0000 +++ b/services/URIBeacon2Service.h Fri Nov 28 14:11:23 2014 +0000 @@ -93,6 +93,12 @@ } /** + * Please note that the following public APIs are offered to allow modifying + * the service programmatically. It is also possible to do so over BLE GATT + * transactions. + */ +public: + /** * Update the txPower for a particular mode in the powerLevels table. */ void setTxPowerLevel(TXPowerModes_t mode, int8_t txPowerIn) { @@ -107,12 +113,20 @@ setup(); } + /** + * The period in milliseconds that a UriBeacon packet is transmitted. + * + * @Note: A value of zero disables UriBeacon transmissions. + */ void setBeaconPeriod(uint16_t beaconPeriodIn) { beaconPeriod = beaconPeriodIn; setup(); } private: + /** + * Private constructor. We want a singleton. + */ URIBeacon2Service(BLEDevice &ble_, const char *urldata, uint8_t flagsIn = 0, int8_t effectiveTxPowerIn = 0, uint16_t beaconPeriodIn = 1000) : ble(ble_), payloadIndex(0), @@ -222,9 +236,9 @@ serviceDataPayload[payloadIndex++] = flags; serviceDataPayload[payloadIndex++] = effectivePower; - const char *urlData = reinterpret_cast<char *>(uriDataValue); + const char *urlData = reinterpret_cast<char *>(uriDataValue); size_t sizeofURLData = uriDataLength; - size_t encodedBytes = encodeURISchemePrefix(urlData, sizeofURLData) + encodeURI(urlData, sizeofURLData); + size_t encodedBytes = encodeURISchemePrefix(urlData, sizeofURLData) + encodeURI(urlData, sizeofURLData); ble.clearAdvertisingPayload(); ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, BEACON_UUID, sizeof(BEACON_UUID));