Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
source/PersistentStorageHelper/ConfigParamsPersistence.h@0:1c7da5f83647, 2016-11-29 (annotated)
- Committer:
- sarahmarshy
- Date:
- Tue Nov 29 06:29:10 2016 +0000
- Revision:
- 0:1c7da5f83647
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sarahmarshy | 0:1c7da5f83647 | 1 | /* mbed Microcontroller Library |
| sarahmarshy | 0:1c7da5f83647 | 2 | * Copyright (c) 2006-2015 ARM Limited |
| sarahmarshy | 0:1c7da5f83647 | 3 | * |
| sarahmarshy | 0:1c7da5f83647 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| sarahmarshy | 0:1c7da5f83647 | 5 | * you may not use this file except in compliance with the License. |
| sarahmarshy | 0:1c7da5f83647 | 6 | * You may obtain a copy of the License at |
| sarahmarshy | 0:1c7da5f83647 | 7 | * |
| sarahmarshy | 0:1c7da5f83647 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| sarahmarshy | 0:1c7da5f83647 | 9 | * |
| sarahmarshy | 0:1c7da5f83647 | 10 | * Unless required by applicable law or agreed to in writing, software |
| sarahmarshy | 0:1c7da5f83647 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| sarahmarshy | 0:1c7da5f83647 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| sarahmarshy | 0:1c7da5f83647 | 13 | * See the License for the specific language governing permissions and |
| sarahmarshy | 0:1c7da5f83647 | 14 | * limitations under the License. |
| sarahmarshy | 0:1c7da5f83647 | 15 | */ |
| sarahmarshy | 0:1c7da5f83647 | 16 | |
| sarahmarshy | 0:1c7da5f83647 | 17 | #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__ |
| sarahmarshy | 0:1c7da5f83647 | 18 | #define __BLE_CONFIG_PARAMS_PERSISTENCE_H__ |
| sarahmarshy | 0:1c7da5f83647 | 19 | |
| sarahmarshy | 0:1c7da5f83647 | 20 | #include "../EddystoneService.h" |
| sarahmarshy | 0:1c7da5f83647 | 21 | |
| sarahmarshy | 0:1c7da5f83647 | 22 | /** |
| sarahmarshy | 0:1c7da5f83647 | 23 | * Generic API to load the Eddystone Service configuration parameters from persistent |
| sarahmarshy | 0:1c7da5f83647 | 24 | * storage. If persistent storage isn't available, the persistenceSignature |
| sarahmarshy | 0:1c7da5f83647 | 25 | * member of params may be left un-initialized to the MAGIC, and this will cause |
| sarahmarshy | 0:1c7da5f83647 | 26 | * a reset to default values. |
| sarahmarshy | 0:1c7da5f83647 | 27 | * |
| sarahmarshy | 0:1c7da5f83647 | 28 | * @param[out] paramsP |
| sarahmarshy | 0:1c7da5f83647 | 29 | * The parameters to be filled in from persistence storage. This |
| sarahmarshy | 0:1c7da5f83647 | 30 | * argument can be NULL if the caller is only interested in |
| sarahmarshy | 0:1c7da5f83647 | 31 | * discovering the persistence status of params. |
| sarahmarshy | 0:1c7da5f83647 | 32 | * |
| sarahmarshy | 0:1c7da5f83647 | 33 | * @return true if params were loaded from persistent storage and have usefully |
| sarahmarshy | 0:1c7da5f83647 | 34 | * initialized fields. |
| sarahmarshy | 0:1c7da5f83647 | 35 | */ |
| sarahmarshy | 0:1c7da5f83647 | 36 | bool loadEddystoneServiceConfigParams(EddystoneService::EddystoneParams_t *paramsP); |
| sarahmarshy | 0:1c7da5f83647 | 37 | |
| sarahmarshy | 0:1c7da5f83647 | 38 | /** |
| sarahmarshy | 0:1c7da5f83647 | 39 | * Generic API to store the Eddystone Service configuration parameters to persistent |
| sarahmarshy | 0:1c7da5f83647 | 40 | * storage. It typically initializes the persistenceSignature member of the |
| sarahmarshy | 0:1c7da5f83647 | 41 | * params to the MAGIC value to indicate persistence. |
| sarahmarshy | 0:1c7da5f83647 | 42 | * |
| sarahmarshy | 0:1c7da5f83647 | 43 | * @param[in,out] paramsP |
| sarahmarshy | 0:1c7da5f83647 | 44 | * The params to be saved; persistenceSignature member gets |
| sarahmarshy | 0:1c7da5f83647 | 45 | * updated if persistence is successful. |
| sarahmarshy | 0:1c7da5f83647 | 46 | * |
| sarahmarshy | 0:1c7da5f83647 | 47 | * @note The save operation may be asynchronous. It may be a short while before |
| sarahmarshy | 0:1c7da5f83647 | 48 | * the request takes affect. Reading back saved configParams may not yield |
| sarahmarshy | 0:1c7da5f83647 | 49 | * correct behaviour if attempted soon after a store. |
| sarahmarshy | 0:1c7da5f83647 | 50 | */ |
| sarahmarshy | 0:1c7da5f83647 | 51 | void saveEddystoneServiceConfigParams(const EddystoneService::EddystoneParams_t *paramsP); |
| sarahmarshy | 0:1c7da5f83647 | 52 | |
| sarahmarshy | 0:1c7da5f83647 | 53 | /** |
| sarahmarshy | 0:1c7da5f83647 | 54 | * Generic API to store the Eddystone TimeParams (a subset of Config Params) for |
| sarahmarshy | 0:1c7da5f83647 | 55 | * speed/power efficiency. |
| sarahmarshy | 0:1c7da5f83647 | 56 | * |
| sarahmarshy | 0:1c7da5f83647 | 57 | * @param[in,out] timeP |
| sarahmarshy | 0:1c7da5f83647 | 58 | * The params to be saved; persistenceSignature member gets |
| sarahmarshy | 0:1c7da5f83647 | 59 | * updated if persistence is successful. |
| sarahmarshy | 0:1c7da5f83647 | 60 | * |
| sarahmarshy | 0:1c7da5f83647 | 61 | * @note The save operation may be asynchronous. It may be a short while before |
| sarahmarshy | 0:1c7da5f83647 | 62 | * the request takes affect. Reading back saved configParams may not yield |
| sarahmarshy | 0:1c7da5f83647 | 63 | * correct behaviour if attempted soon after a store. |
| sarahmarshy | 0:1c7da5f83647 | 64 | */ |
| sarahmarshy | 0:1c7da5f83647 | 65 | void saveEddystoneTimeParams(const TimeParams_t *timeP); |
| sarahmarshy | 0:1c7da5f83647 | 66 | |
| sarahmarshy | 0:1c7da5f83647 | 67 | #endif /* #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__*/ |