Introduced fix for defect IOTSFW-1058

Introduced a fix for defect IOTSFW-1058 that caused the
BLE_EddystoneBeaconConfigService example in ARMmbed/ble-examples repo to fail.
Refer to JIRA defect for more details.
This commit is contained in:
Andres Amaya Garcia 2015-10-21 15:02:37 +01:00
parent d43b1d1a8b
commit 18dcc91382
2 changed files with 24 additions and 1 deletions

View file

@ -306,7 +306,7 @@ public:
eddyServ.setTLMFrameData(params.tlmVersion, params.tlmBeaconPeriod);
}
if (params.uriEnabled) {
eddyServ.setURLFrameData(params.advPowerLevels[params.txPowerMode], (const char *) params.uriData, params.uriBeaconPeriod);
eddyServ.setURLFrameEncodedData(params.advPowerLevels[params.txPowerMode], (const char *) params.uriData, params.uriDataLength, params.uriBeaconPeriod);
}
if (params.uidEnabled) {
eddyServ.setUIDFrameData(params.advPowerLevels[params.txPowerMode],

View file

@ -185,6 +185,29 @@ public:
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