@@ -55,7 +55,7 @@ CHIP_ERROR DefaultOTARequestorStorage::StoreDefaultProviders(const ProviderLocat
55
55
56
56
ReturnErrorOnFailure (writer.EndContainer (outerType));
57
57
58
- return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTADefaultProviders (), buffer,
58
+ return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTADefaultProviders (). KeyName () , buffer,
59
59
static_cast <uint16_t >(writer.GetLengthWritten ()));
60
60
}
61
61
@@ -64,7 +64,7 @@ CHIP_ERROR DefaultOTARequestorStorage::LoadDefaultProviders(ProviderLocationList
64
64
uint8_t buffer[kProviderListMaxSerializedSize ];
65
65
MutableByteSpan bufferSpan (buffer);
66
66
67
- ReturnErrorOnFailure (Load (DefaultStorageKeyAllocator::OTADefaultProviders (), bufferSpan));
67
+ ReturnErrorOnFailure (Load (DefaultStorageKeyAllocator::OTADefaultProviders (). KeyName () , bufferSpan));
68
68
69
69
TLV::TLVReader reader;
70
70
TLV::TLVType outerType;
@@ -93,21 +93,21 @@ CHIP_ERROR DefaultOTARequestorStorage::StoreCurrentProviderLocation(const Provid
93
93
writer.Init (buffer);
94
94
ReturnErrorOnFailure (provider.EncodeForRead (writer, TLV::AnonymousTag (), provider.fabricIndex ));
95
95
96
- return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTACurrentProvider (), buffer,
96
+ return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTACurrentProvider (). KeyName () , buffer,
97
97
static_cast <uint16_t >(writer.GetLengthWritten ()));
98
98
}
99
99
100
100
CHIP_ERROR DefaultOTARequestorStorage::ClearCurrentProviderLocation ()
101
101
{
102
- return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTACurrentProvider ());
102
+ return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTACurrentProvider (). KeyName () );
103
103
}
104
104
105
105
CHIP_ERROR DefaultOTARequestorStorage::LoadCurrentProviderLocation (ProviderLocationType & provider)
106
106
{
107
107
uint8_t buffer[kProviderMaxSerializedSize ];
108
108
MutableByteSpan bufferSpan (buffer);
109
109
110
- ReturnErrorOnFailure (Load (DefaultStorageKeyAllocator::OTACurrentProvider (), bufferSpan));
110
+ ReturnErrorOnFailure (Load (DefaultStorageKeyAllocator::OTACurrentProvider (). KeyName () , bufferSpan));
111
111
112
112
TLV::TLVReader reader;
113
113
@@ -120,54 +120,55 @@ CHIP_ERROR DefaultOTARequestorStorage::LoadCurrentProviderLocation(ProviderLocat
120
120
121
121
CHIP_ERROR DefaultOTARequestorStorage::StoreUpdateToken (ByteSpan updateToken)
122
122
{
123
- return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTAUpdateToken (), updateToken.data (),
123
+ return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTAUpdateToken (). KeyName () , updateToken.data (),
124
124
static_cast <uint16_t >(updateToken.size ()));
125
125
}
126
126
127
127
CHIP_ERROR DefaultOTARequestorStorage::ClearUpdateToken ()
128
128
{
129
- return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTAUpdateToken ());
129
+ return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTAUpdateToken (). KeyName () );
130
130
}
131
131
132
132
CHIP_ERROR DefaultOTARequestorStorage::LoadUpdateToken (MutableByteSpan & updateToken)
133
133
{
134
- return Load (DefaultStorageKeyAllocator::OTAUpdateToken (), updateToken);
134
+ return Load (DefaultStorageKeyAllocator::OTAUpdateToken (). KeyName () , updateToken);
135
135
}
136
136
137
137
CHIP_ERROR DefaultOTARequestorStorage::StoreCurrentUpdateState (OTAUpdateStateEnum currentUpdateState)
138
138
{
139
- return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState (), ¤tUpdateState,
139
+ return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState (). KeyName () , ¤tUpdateState,
140
140
sizeof (currentUpdateState));
141
141
}
142
142
143
143
CHIP_ERROR DefaultOTARequestorStorage::LoadCurrentUpdateState (OTAUpdateStateEnum & currentUpdateState)
144
144
{
145
145
uint16_t size = static_cast <uint16_t >(sizeof (currentUpdateState));
146
146
147
- return mPersistentStorage ->SyncGetKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState (), ¤tUpdateState, size);
147
+ return mPersistentStorage ->SyncGetKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState ().KeyName (), ¤tUpdateState,
148
+ size);
148
149
}
149
150
150
151
CHIP_ERROR DefaultOTARequestorStorage::ClearCurrentUpdateState ()
151
152
{
152
- return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState ());
153
+ return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTACurrentUpdateState (). KeyName () );
153
154
}
154
155
155
156
CHIP_ERROR DefaultOTARequestorStorage::StoreTargetVersion (uint32_t targetVersion)
156
157
{
157
- return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTATargetVersion (), &targetVersion,
158
+ return mPersistentStorage ->SyncSetKeyValue (DefaultStorageKeyAllocator::OTATargetVersion (). KeyName () , &targetVersion,
158
159
sizeof (targetVersion));
159
160
}
160
161
161
162
CHIP_ERROR DefaultOTARequestorStorage::LoadTargetVersion (uint32_t & targetVersion)
162
163
{
163
164
uint16_t size = static_cast <uint16_t >(sizeof (targetVersion));
164
165
165
- return mPersistentStorage ->SyncGetKeyValue (DefaultStorageKeyAllocator::OTATargetVersion (), &targetVersion, size);
166
+ return mPersistentStorage ->SyncGetKeyValue (DefaultStorageKeyAllocator::OTATargetVersion (). KeyName () , &targetVersion, size);
166
167
}
167
168
168
169
CHIP_ERROR DefaultOTARequestorStorage::ClearTargetVersion ()
169
170
{
170
- return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTATargetVersion ());
171
+ return mPersistentStorage ->SyncDeleteKeyValue (DefaultStorageKeyAllocator::OTATargetVersion (). KeyName () );
171
172
}
172
173
173
174
CHIP_ERROR DefaultOTARequestorStorage::Load (const char * key, MutableByteSpan & buffer)
0 commit comments