An updated version of the URIBeacon implementation that uses the new Eddystone-URL format.
Dependencies: BLE_API mbed nRF51822
ConfigParamsPersistence.h@2:420532c6dd54, 2015-08-19 (annotated)
- Committer:
- roywant
- Date:
- Wed Aug 19 04:41:21 2015 +0000
- Revision:
- 2:420532c6dd54
- Parent:
- 1:0ad7573b5918
On disconnect: a) Timer is stopped b) ADV parameters recreated c) starts advertizing. This is so that the ADV starts again right after disconnect. Before it only started after the long timeout, which makes it hard for the Validator to do its work.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
roywant | 0:094734b4e8bd | 1 | /* mbed Microcontroller Library |
roywant | 0:094734b4e8bd | 2 | * Copyright (c) 2006-2015 ARM Limited |
roywant | 0:094734b4e8bd | 3 | * |
roywant | 0:094734b4e8bd | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
roywant | 0:094734b4e8bd | 5 | * you may not use this file except in compliance with the License. |
roywant | 0:094734b4e8bd | 6 | * You may obtain a copy of the License at |
roywant | 0:094734b4e8bd | 7 | * |
roywant | 0:094734b4e8bd | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
roywant | 0:094734b4e8bd | 9 | * |
roywant | 0:094734b4e8bd | 10 | * Unless required by applicable law or agreed to in writing, software |
roywant | 0:094734b4e8bd | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
roywant | 0:094734b4e8bd | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
roywant | 0:094734b4e8bd | 13 | * See the License for the specific language governing permissions and |
roywant | 0:094734b4e8bd | 14 | * limitations under the License. |
roywant | 0:094734b4e8bd | 15 | */ |
roywant | 0:094734b4e8bd | 16 | |
roywant | 0:094734b4e8bd | 17 | #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__ |
roywant | 0:094734b4e8bd | 18 | #define __BLE_CONFIG_PARAMS_PERSISTENCE_H__ |
roywant | 0:094734b4e8bd | 19 | |
roywant | 1:0ad7573b5918 | 20 | #include "ble/services/EddystoneURLConfigService.h" |
roywant | 0:094734b4e8bd | 21 | |
roywant | 0:094734b4e8bd | 22 | /** |
roywant | 1:0ad7573b5918 | 23 | * Generic API to load the Eddystone-URL configuration parameters from persistent |
roywant | 0:094734b4e8bd | 24 | * storage. If persistent storage isn't available, the persistenceSignature |
roywant | 0:094734b4e8bd | 25 | * member of params may be left un-initialized to the MAGIC, and this will cause |
roywant | 0:094734b4e8bd | 26 | * a reset to default values. |
roywant | 0:094734b4e8bd | 27 | * |
roywant | 0:094734b4e8bd | 28 | * @param[out] paramsP |
roywant | 0:094734b4e8bd | 29 | * The parameters to be filled in from persistence storage. This |
roywant | 0:094734b4e8bd | 30 | argument can be NULL if the caller is only interested in |
roywant | 0:094734b4e8bd | 31 | discovering the persistence status of params. |
roywant | 0:094734b4e8bd | 32 | |
roywant | 0:094734b4e8bd | 33 | * @return true if params were loaded from persistent storage and have usefully |
roywant | 0:094734b4e8bd | 34 | * initialized fields. |
roywant | 0:094734b4e8bd | 35 | */ |
roywant | 1:0ad7573b5918 | 36 | bool loadEddystoneURLConfigParams(EddystoneURLConfigService::Params_t *paramsP); |
roywant | 0:094734b4e8bd | 37 | |
roywant | 0:094734b4e8bd | 38 | /** |
roywant | 1:0ad7573b5918 | 39 | * Generic API to store the Eddystone-URL configuration parameters to persistent |
roywant | 0:094734b4e8bd | 40 | * storage. It typically initializes the persistenceSignature member of the |
roywant | 0:094734b4e8bd | 41 | * params to the MAGIC value to indicate persistence. |
roywant | 0:094734b4e8bd | 42 | * |
roywant | 0:094734b4e8bd | 43 | * @note: the save operation may be asynchronous. It may be a short while before |
roywant | 0:094734b4e8bd | 44 | * the request takes affect. Reading back saved configParams may not yield |
roywant | 0:094734b4e8bd | 45 | * correct behaviour if attempted soon after a store. |
roywant | 0:094734b4e8bd | 46 | * |
roywant | 0:094734b4e8bd | 47 | * @param[in/out] paramsP |
roywant | 0:094734b4e8bd | 48 | * The params to be saved; persistenceSignature member gets |
roywant | 0:094734b4e8bd | 49 | * updated if persistence is successful. |
roywant | 0:094734b4e8bd | 50 | */ |
roywant | 1:0ad7573b5918 | 51 | void saveEddystoneURLConfigParams(const EddystoneURLConfigService::Params_t *paramsP); |
roywant | 0:094734b4e8bd | 52 | |
roywant | 0:094734b4e8bd | 53 | #endif /* #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__*/ |