Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 3 | * <COPYRIGHT> |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 4 | * |
| 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 Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 24 | #include <platform/internal/CHIPDeviceLayerInternal.h> |
| 25 | #include <platform/ConfigurationManager.h> |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 26 | |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 27 | namespace chip { |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 28 | namespace Platform { |
| 29 | namespace PersistedStorage { |
| 30 | |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 31 | using namespace ::chip::DeviceLayer; |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 32 | |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 33 | CHIP_ERROR Read(Key key, uint32_t & value) |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 34 | { |
| 35 | return ConfigurationMgr().ReadPersistedStorageValue(key, value); |
| 36 | } |
| 37 | |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 38 | CHIP_ERROR Write(Key key, uint32_t value) |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 39 | { |
| 40 | return ConfigurationMgr().WritePersistedStorageValue(key, value); |
| 41 | } |
| 42 | |
| 43 | } // PersistedStorage |
| 44 | } // Platform |
Pankaj Garg | b09f024 | 2020-03-23 17:16:57 -0700 | [diff] [blame^] | 45 | } // chip |
Pankaj Garg | ad2b6e7 | 2020-03-23 16:47:53 -0700 | [diff] [blame] | 46 | |