prova invio BLE
Dependents: BLE_HeartRate_IDB04A1
Fork of BLE_API by
Diff: ble/services/EddystoneConfigService.h
- Revision:
- 912:f728aa46e7df
- Parent:
- 907:f9a79127973a
--- a/ble/services/EddystoneConfigService.h Thu Nov 26 12:52:03 2015 +0000 +++ b/ble/services/EddystoneConfigService.h Thu Nov 26 12:52:03 2015 +0000 @@ -215,7 +215,7 @@ DBG("Setting Default TLM Data, version = %d, advPeriodInMind= %f", tlmVersionIn, advPeriodInSec); defaultTlmVersion = tlmVersionIn; TlmBatteryVoltage = 0; - TlmBeaconTemp = 0; + TlmBeaconTemp = 0x8000; TlmPduCount = 0; TlmTimeSinceBoot = 0; defaultTlmAdvPeriod = advPeriodInSec; @@ -285,7 +285,7 @@ ble.setTxPower(radioPowerLevels[params.txPowerMode]); ble.setDeviceName(reinterpret_cast<const uint8_t *>(&DEVICE_NAME)); ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); - ble.setAdvertisingInterval(GapAdvertisingParams::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(ADVERTISING_INTERVAL_MSEC)); + ble.setAdvertisingInterval(ADVERTISING_INTERVAL_MSEC); } /* @@ -306,7 +306,7 @@ 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], @@ -340,7 +340,7 @@ } else if (handle == uriDataChar.getValueHandle()) { params.uriDataLength = writeParams->len; memset(params.uriData, 0x00, URI_DATA_MAX); // clear URI string - memcpy(params.uriData, writeParams->data, params.uriDataLength); // set URI string + memcpy(params.uriData, writeParams->data, writeParams->len); // set URI string params.uriEnabled = true; INFO("URI = %s, URILen = %d", writeParams->data, writeParams->len); } else if (handle == flagsChar.getValueHandle()) { @@ -389,7 +389,7 @@ params.flags = 0x10; memcpy(params.advPowerLevels, defaultAdvPowerLevels, sizeof(PowerLevels_t)); params.txPowerMode = TX_POWER_MODE_LOW; - params.beaconPeriod = 1000; + params.beaconPeriod = (uint16_t) defaultUriAdvPeriod * 1000; // TLM Frame params.tlmVersion = defaultTlmVersion;