BLE_API for nRF51
Fork of BLE_API by
Diff: ble/services/EddystoneService.h
- Revision:
- 841:468a5863cacb
- Parent:
- 832:5dac246f8f02
- Child:
- 842:4f7f7a4b0cb2
--- a/ble/services/EddystoneService.h Mon Nov 02 09:09:04 2015 +0000 +++ b/ble/services/EddystoneService.h Mon Nov 02 09:09:04 2015 +0000 @@ -185,6 +185,29 @@ return false; } + /** + * Set Eddystone URL Frame information. + * @param[in] power TX Power in dB measured at 0 meters from the device. + * @param[in] url Encoded URL + * @param[in] urlAdvPeriodIn How long to advertise the URL frame (measured in # of adv periods) + * @return false on success, true on failure. + */ + bool setURLFrameEncodedData(int8_t power, const char *encodedUrlIn, uint8_t encodedUriInLength, uint32_t urlAdvPeriodIn) { + if (0 == urlAdvPeriodIn) { + urlIsSet = false; + return false; + } + defaultUrlPower = power; + memcpy(defaultUriData, encodedUrlIn, URI_DATA_MAX); + defaultUriDataLength = encodedUriInLength; + if (defaultUriDataLength > URI_DATA_MAX) { + return true; // error, URL is too big + } + urlAdvPeriod = urlAdvPeriodIn; + urlIsSet = true; + return false; + } + /* * Construct URL frame from private variables * @param[in/out] Data pointer to array to store constructed frame in