Roy Want / Mbed OS beaconCompileReadyFork
Committer:
roywant
Date:
Mon Sep 19 00:59:11 2016 +0000
Revision:
0:ed0152b5c495
Initial commit

Who changed what in which revision?

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