blob: 291e0adec6c5ca7f7247094ba905b92378ff898a [file] [log] [blame]
Pankaj Gargad2b6e72020-03-23 16:47:53 -07001/*
2 *
Pankaj Gargb09f0242020-03-23 17:16:57 -07003 * <COPYRIGHT>
Pankaj Gargad2b6e72020-03-23 16:47:53 -07004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/**
19 * @file
20 * Provides implementations for the OpenWeave persistent storage
21 * APIs. This implementation is common across all platforms.
22 */
23
Pankaj Gargb09f0242020-03-23 17:16:57 -070024#include <platform/internal/CHIPDeviceLayerInternal.h>
25#include <platform/ConfigurationManager.h>
Pankaj Gargad2b6e72020-03-23 16:47:53 -070026
Pankaj Gargb09f0242020-03-23 17:16:57 -070027namespace chip {
Pankaj Gargad2b6e72020-03-23 16:47:53 -070028namespace Platform {
29namespace PersistedStorage {
30
Pankaj Gargb09f0242020-03-23 17:16:57 -070031using namespace ::chip::DeviceLayer;
Pankaj Gargad2b6e72020-03-23 16:47:53 -070032
Pankaj Gargb09f0242020-03-23 17:16:57 -070033CHIP_ERROR Read(Key key, uint32_t & value)
Pankaj Gargad2b6e72020-03-23 16:47:53 -070034{
35 return ConfigurationMgr().ReadPersistedStorageValue(key, value);
36}
37
Pankaj Gargb09f0242020-03-23 17:16:57 -070038CHIP_ERROR Write(Key key, uint32_t value)
Pankaj Gargad2b6e72020-03-23 16:47:53 -070039{
40 return ConfigurationMgr().WritePersistedStorageValue(key, value);
41}
42
43} // PersistedStorage
44} // Platform
Pankaj Gargb09f0242020-03-23 17:16:57 -070045} // chip
Pankaj Gargad2b6e72020-03-23 16:47:53 -070046