The eddystone config service allows you to configure the eddystone frame data over BLE for a set period of time and then starts an eddystone beacon. This example defaults to 30 seconds of config time.

Dependencies:   BLE_API mbed nRF51822 X_NUCLEO_IDB0XA1

Fork of BLE_EddystoneBeaconConfigServiceRelease by Austin Blackstone

This is the eddystone config service. This code starts up and for a user configured time period (default 30 seconds) will advertise the configuration service.

The configuration service allows for modifying various frames of the eddystone specification.

For more details on the Configuration Service please see : https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md

Committer:
Vincent Coubard
Date:
Tue Sep 20 14:21:04 2016 +0100
Revision:
8:f53d48e5d64f
Parent:
6:321047f0190a
Update libraries and add support of ST shield.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andresag 6:321047f0190a 1 /* mbed Microcontroller Library
andresag 6:321047f0190a 2 * Copyright (c) 2006-2015 ARM Limited
andresag 6:321047f0190a 3 *
andresag 6:321047f0190a 4 * Licensed under the Apache License, Version 2.0 (the "License");
andresag 6:321047f0190a 5 * you may not use this file except in compliance with the License.
andresag 6:321047f0190a 6 * You may obtain a copy of the License at
andresag 6:321047f0190a 7 *
andresag 6:321047f0190a 8 * http://www.apache.org/licenses/LICENSE-2.0
andresag 6:321047f0190a 9 *
andresag 6:321047f0190a 10 * Unless required by applicable law or agreed to in writing, software
andresag 6:321047f0190a 11 * distributed under the License is distributed on an "AS IS" BASIS,
andresag 6:321047f0190a 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
andresag 6:321047f0190a 13 * See the License for the specific language governing permissions and
andresag 6:321047f0190a 14 * limitations under the License.
andresag 6:321047f0190a 15 */
andresag 6:321047f0190a 16
andresag 6:321047f0190a 17 #ifndef __TLMFRAME_H__
andresag 6:321047f0190a 18 #define __TLMFRAME_H__
andresag 6:321047f0190a 19
andresag 6:321047f0190a 20 #include "EddystoneTypes.h"
andresag 6:321047f0190a 21
andresag 6:321047f0190a 22 class TLMFrame
andresag 6:321047f0190a 23 {
andresag 6:321047f0190a 24 public:
andresag 6:321047f0190a 25 TLMFrame(uint8_t tlmVersionIn = 0,
andresag 6:321047f0190a 26 uint16_t tlmBatteryVoltageIn = 0,
andresag 6:321047f0190a 27 uint16_t tlmBeaconTemperatureIn = 0x8000,
andresag 6:321047f0190a 28 uint32_t tlmPduCountIn = 0,
andresag 6:321047f0190a 29 uint32_t tlmTimeSinceBootIn = 0);
andresag 6:321047f0190a 30
andresag 6:321047f0190a 31 void setTLMData(uint8_t tlmVersionIn = 0);
andresag 6:321047f0190a 32
andresag 6:321047f0190a 33 void constructTLMFrame(uint8_t *rawFrame);
andresag 6:321047f0190a 34
andresag 6:321047f0190a 35 size_t getRawFrameSize(void) const;
andresag 6:321047f0190a 36
andresag 6:321047f0190a 37 void updateTimeSinceBoot(uint32_t nowInMillis);
andresag 6:321047f0190a 38
andresag 6:321047f0190a 39 void updateBatteryVoltage(uint16_t tlmBatteryVoltageIn);
andresag 6:321047f0190a 40
andresag 6:321047f0190a 41 void updateBeaconTemperature(uint16_t tlmBeaconTemperatureIn);
andresag 6:321047f0190a 42
andresag 6:321047f0190a 43 void updatePduCount(void);
andresag 6:321047f0190a 44
andresag 6:321047f0190a 45 uint16_t getBatteryVoltage(void) const;
andresag 6:321047f0190a 46
andresag 6:321047f0190a 47 uint16_t getBeaconTemperature(void) const;
andresag 6:321047f0190a 48
andresag 6:321047f0190a 49 uint8_t getTLMVersion(void) const;
andresag 6:321047f0190a 50
andresag 6:321047f0190a 51 private:
andresag 6:321047f0190a 52 static const uint8_t FRAME_TYPE_TLM = 0x20;
andresag 6:321047f0190a 53 static const uint8_t FRAME_SIZE_TLM = 14;
andresag 6:321047f0190a 54
andresag 6:321047f0190a 55 uint8_t tlmVersion;
andresag 6:321047f0190a 56 uint32_t lastTimeSinceBootRead;
andresag 6:321047f0190a 57 uint16_t tlmBatteryVoltage;
andresag 6:321047f0190a 58 uint16_t tlmBeaconTemperature;
andresag 6:321047f0190a 59 uint32_t tlmPduCount;
andresag 6:321047f0190a 60 uint32_t tlmTimeSinceBoot;
andresag 6:321047f0190a 61 };
andresag 6:321047f0190a 62
andresag 6:321047f0190a 63 #endif /* __TLMFRAME_H__ */