For switch science magazine

Dependencies:   BLE_API mbed nRF51822

Fork of mbed_EddystoneURL_Beacon by Roy Want

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ConfigParamsPersistence.h Source File

ConfigParamsPersistence.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2006-2015 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__
00018 #define __BLE_CONFIG_PARAMS_PERSISTENCE_H__
00019 
00020 #include "ble/services/EddystoneURLConfigService.h"
00021 
00022 /**
00023  * Generic API to load the Eddystone-URL configuration parameters from persistent
00024  * storage. If persistent storage isn't available, the persistenceSignature
00025  * member of params may be left un-initialized to the MAGIC, and this will cause
00026  * a reset to default values.
00027  *
00028  * @param[out] paramsP
00029  *                 The parameters to be filled in from persistence storage. This
00030                    argument can be NULL if the caller is only interested in
00031                    discovering the persistence status of params.
00032 
00033  * @return true if params were loaded from persistent storage and have usefully
00034  *         initialized fields.
00035  */
00036 bool loadEddystoneURLConfigParams(EddystoneURLConfigService::Params_t *paramsP);
00037 
00038 /**
00039  * Generic API to store the Eddystone-URL configuration parameters to persistent
00040  * storage. It typically initializes the persistenceSignature member of the
00041  * params to the MAGIC value to indicate persistence.
00042  *
00043  * @note: the save operation may be asynchronous. It may be a short while before
00044  * the request takes affect. Reading back saved configParams may not yield
00045  * correct behaviour if attempted soon after a store.
00046  *
00047  * @param[in/out] paramsP
00048  *                    The params to be saved; persistenceSignature member gets
00049  *                    updated if persistence is successful.
00050  */
00051 void saveEddystoneURLConfigParams(const EddystoneURLConfigService::Params_t *paramsP);
00052 
00053 #endif /* #ifndef __BLE_CONFIG_PARAMS_PERSISTENCE_H__*/