From 09a38f1e57eafea40f6d04e4275af8bbe785345d Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Fri, 28 Nov 2014 09:47:55 +0000 Subject: [PATCH] comment headers and minor white space diffs. --- services/URIBeacon2Service.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/services/URIBeacon2Service.h b/services/URIBeacon2Service.h index aea66e7..5bdb2f7 100644 --- a/services/URIBeacon2Service.h +++ b/services/URIBeacon2Service.h @@ -92,6 +92,12 @@ public: setup(); } + /** + * 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. */ @@ -107,12 +113,20 @@ public: 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 @@ private: serviceDataPayload[payloadIndex++] = flags; serviceDataPayload[payloadIndex++] = effectivePower; - const char *urlData = reinterpret_cast(uriDataValue); + const char *urlData = reinterpret_cast(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));