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 __EDDYSTONETYPES_H__
andresag 6:321047f0190a 18 #define __EDDYSTONETYPES_H__
andresag 6:321047f0190a 19
andresag 6:321047f0190a 20 #include <stdint.h>
andresag 6:321047f0190a 21 #include <stddef.h>
andresag 6:321047f0190a 22
andresag 6:321047f0190a 23 #define UUID_URL_BEACON(FIRST, SECOND) { \
andresag 6:321047f0190a 24 0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \
andresag 6:321047f0190a 25 0xab, 0x96, 0x99, 0xb9, 0x1a, 0xc9, 0x81, 0xd8, \
andresag 6:321047f0190a 26 }
andresag 6:321047f0190a 27
andresag 6:321047f0190a 28 const uint8_t EDDYSTONE_UUID[] = {0xAA, 0xFE};
andresag 6:321047f0190a 29
andresag 6:321047f0190a 30 const uint8_t UUID_URL_BEACON_SERVICE[] = UUID_URL_BEACON(0x20, 0x80);
andresag 6:321047f0190a 31 const uint8_t UUID_LOCK_STATE_CHAR[] = UUID_URL_BEACON(0x20, 0x81);
andresag 6:321047f0190a 32 const uint8_t UUID_LOCK_CHAR[] = UUID_URL_BEACON(0x20, 0x82);
andresag 6:321047f0190a 33 const uint8_t UUID_UNLOCK_CHAR[] = UUID_URL_BEACON(0x20, 0x83);
andresag 6:321047f0190a 34 const uint8_t UUID_URL_DATA_CHAR[] = UUID_URL_BEACON(0x20, 0x84);
andresag 6:321047f0190a 35 const uint8_t UUID_FLAGS_CHAR[] = UUID_URL_BEACON(0x20, 0x85);
andresag 6:321047f0190a 36 const uint8_t UUID_ADV_POWER_LEVELS_CHAR[] = UUID_URL_BEACON(0x20, 0x86);
andresag 6:321047f0190a 37 const uint8_t UUID_TX_POWER_MODE_CHAR[] = UUID_URL_BEACON(0x20, 0x87);
andresag 6:321047f0190a 38 const uint8_t UUID_BEACON_PERIOD_CHAR[] = UUID_URL_BEACON(0x20, 0x88);
andresag 6:321047f0190a 39 const uint8_t UUID_RESET_CHAR[] = UUID_URL_BEACON(0x20, 0x89);
andresag 6:321047f0190a 40
andresag 6:321047f0190a 41 const char DEVICE_NAME[] = "EDDYSTONE CONFIG";
andresag 6:321047f0190a 42
andresag 6:321047f0190a 43 const char DEFAULT_URL[] = "http://www.mbed.com/";
andresag 6:321047f0190a 44
andresag 6:321047f0190a 45 enum PowerModes {
andresag 6:321047f0190a 46 TX_POWER_MODE_LOWEST,
andresag 6:321047f0190a 47 TX_POWER_MODE_LOW,
andresag 6:321047f0190a 48 TX_POWER_MODE_MEDIUM,
andresag 6:321047f0190a 49 TX_POWER_MODE_HIGH,
andresag 6:321047f0190a 50 NUM_POWER_MODES
andresag 6:321047f0190a 51 };
andresag 6:321047f0190a 52
andresag 6:321047f0190a 53 /* 128 bits of lock */
andresag 6:321047f0190a 54 typedef uint8_t Lock_t[16];
andresag 6:321047f0190a 55 typedef int8_t PowerLevels_t[NUM_POWER_MODES];
andresag 6:321047f0190a 56
andresag 6:321047f0190a 57 const uint16_t URL_DATA_MAX = 18;
andresag 6:321047f0190a 58 typedef uint8_t UrlData_t[URL_DATA_MAX];
andresag 6:321047f0190a 59
andresag 6:321047f0190a 60 /* UID Frame Type subfields */
andresag 6:321047f0190a 61 const size_t UID_NAMESPACEID_SIZE = 10;
andresag 6:321047f0190a 62 typedef uint8_t UIDNamespaceID_t[UID_NAMESPACEID_SIZE];
andresag 6:321047f0190a 63 const size_t UID_INSTANCEID_SIZE = 6;
andresag 6:321047f0190a 64 typedef uint8_t UIDInstanceID_t[UID_INSTANCEID_SIZE];
andresag 6:321047f0190a 65
andresag 6:321047f0190a 66 /* Callbacks for updating BateryVoltage and Temperature */
andresag 6:321047f0190a 67 typedef uint16_t (*TlmUpdateCallback_t) (uint16_t);
andresag 6:321047f0190a 68
andresag 6:321047f0190a 69 /* Size of Eddystone UUID needed for all frames */
andresag 6:321047f0190a 70 const uint16_t EDDYSTONE_UUID_SIZE = sizeof(EDDYSTONE_UUID);
andresag 6:321047f0190a 71
andresag 6:321047f0190a 72 #endif /* __EDDYSTONETYPES_H__ */