jan

Dependencies:   BLE_API mbed nRF51822

Committer:
janjongboom
Date:
Sat Nov 14 09:39:14 2015 +0000
Revision:
0:f17fb1bb4f3a
jan

Who changed what in which revision?

UserRevisionLine numberNew contents of line
janjongboom 0:f17fb1bb4f3a 1 /* mbed Microcontroller Library
janjongboom 0:f17fb1bb4f3a 2 * Copyright (c) 2006-2015 ARM Limited
janjongboom 0:f17fb1bb4f3a 3 *
janjongboom 0:f17fb1bb4f3a 4 * Licensed under the Apache License, Version 2.0 (the "License");
janjongboom 0:f17fb1bb4f3a 5 * you may not use this file except in compliance with the License.
janjongboom 0:f17fb1bb4f3a 6 * You may obtain a copy of the License at
janjongboom 0:f17fb1bb4f3a 7 *
janjongboom 0:f17fb1bb4f3a 8 * http://www.apache.org/licenses/LICENSE-2.0
janjongboom 0:f17fb1bb4f3a 9 *
janjongboom 0:f17fb1bb4f3a 10 * Unless required by applicable law or agreed to in writing, software
janjongboom 0:f17fb1bb4f3a 11 * distributed under the License is distributed on an "AS IS" BASIS,
janjongboom 0:f17fb1bb4f3a 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
janjongboom 0:f17fb1bb4f3a 13 * See the License for the specific language governing permissions and
janjongboom 0:f17fb1bb4f3a 14 * limitations under the License.
janjongboom 0:f17fb1bb4f3a 15 */
janjongboom 0:f17fb1bb4f3a 16
janjongboom 0:f17fb1bb4f3a 17 #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__
janjongboom 0:f17fb1bb4f3a 18 #define __BLE_CONFIG_PARAMS_PERSISTENCE_H__
janjongboom 0:f17fb1bb4f3a 19
janjongboom 0:f17fb1bb4f3a 20 #include "ble/services/URIBeaconConfigService.h"
janjongboom 0:f17fb1bb4f3a 21
janjongboom 0:f17fb1bb4f3a 22 /**
janjongboom 0:f17fb1bb4f3a 23 * Generic API to load the URIBeacon configuration parameters from persistent
janjongboom 0:f17fb1bb4f3a 24 * storage. If persistent storage isn't available, the persistenceSignature
janjongboom 0:f17fb1bb4f3a 25 * member of params may be left un-initialized to the MAGIC, and this will cause
janjongboom 0:f17fb1bb4f3a 26 * a reset to default values.
janjongboom 0:f17fb1bb4f3a 27 *
janjongboom 0:f17fb1bb4f3a 28 * @param[out] paramsP
janjongboom 0:f17fb1bb4f3a 29 * The parameters to be filled in from persistence storage. This
janjongboom 0:f17fb1bb4f3a 30 argument can be NULL if the caller is only interested in
janjongboom 0:f17fb1bb4f3a 31 discovering the persistence status of params.
janjongboom 0:f17fb1bb4f3a 32
janjongboom 0:f17fb1bb4f3a 33 * @return true if params were loaded from persistent storage and have usefully
janjongboom 0:f17fb1bb4f3a 34 * initialized fields.
janjongboom 0:f17fb1bb4f3a 35 */
janjongboom 0:f17fb1bb4f3a 36 bool loadURIBeaconConfigParams(URIBeaconConfigService::Params_t *paramsP);
janjongboom 0:f17fb1bb4f3a 37
janjongboom 0:f17fb1bb4f3a 38 /**
janjongboom 0:f17fb1bb4f3a 39 * Generic API to store the URIBeacon configuration parameters to persistent
janjongboom 0:f17fb1bb4f3a 40 * storage. It typically initializes the persistenceSignature member of the
janjongboom 0:f17fb1bb4f3a 41 * params to the MAGIC value to indicate persistence.
janjongboom 0:f17fb1bb4f3a 42 *
janjongboom 0:f17fb1bb4f3a 43 * @note: the save operation may be asynchronous. It may be a short while before
janjongboom 0:f17fb1bb4f3a 44 * the request takes affect. Reading back saved configParams may not yield
janjongboom 0:f17fb1bb4f3a 45 * correct behaviour if attempted soon after a store.
janjongboom 0:f17fb1bb4f3a 46 *
janjongboom 0:f17fb1bb4f3a 47 * @param[in/out] paramsP
janjongboom 0:f17fb1bb4f3a 48 * The params to be saved; persistenceSignature member gets
janjongboom 0:f17fb1bb4f3a 49 * updated if persistence is successful.
janjongboom 0:f17fb1bb4f3a 50 */
janjongboom 0:f17fb1bb4f3a 51 void saveURIBeaconConfigParams(const URIBeaconConfigService::Params_t *paramsP);
janjongboom 0:f17fb1bb4f3a 52
janjongboom 0:f17fb1bb4f3a 53 #endif /* #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__*/