@@ -45,17 +45,18 @@ where
4545 }
4646
4747 /// Reset the persist instance, removing all stored data from the non-volatile storage
48- /// as well as removing all ACLs, fabrics and Wifi networks from the Matter stack.
48+ /// as well as removing all ACLs, fabrics and wireless networks from the Matter stack.
4949 pub async fn reset ( & self ) -> Result < ( ) , Error > {
5050 let ( mut kv, mut buf) = self . store . get ( ) . await ;
5151
5252 kv. remove ( MatterStackKey :: Fabrics as _ , & mut buf) . await ?;
5353 kv. remove ( MatterStackKey :: BasicInfo as _ , & mut buf) . await ?;
5454 kv. remove ( MatterStackKey :: Networks as _ , & mut buf) . await ?;
5555
56- self . networks . reset ( ) ?;
56+ self . matter . reset_persist ( false ) ;
57+ self . networks . reset ( false ) ;
5758
58- Ok ( ( ) )
59+ self . matter . reset_transport ( )
5960 }
6061
6162 /// Load the Matter stack from the non-volatile storage.
@@ -151,7 +152,7 @@ where
151152/// - `&NetworkContext` - which is used with the `WirelessBle` network.
152153pub trait NetworkPersist : Sealed {
153154 /// Reset all networks, removing all stored data from the memory
154- fn reset ( & self ) -> Result < ( ) , Error > ;
155+ fn reset ( & self , flag_changed : bool ) ;
155156
156157 /// Load the networks from the provided data BLOB
157158 fn load ( & self , data : & [ u8 ] ) -> Result < ( ) , Error > ;
@@ -181,10 +182,8 @@ where
181182 M : RawMutex ,
182183 T : WirelessNetwork ,
183184{
184- fn reset ( & self ) -> Result < ( ) , Error > {
185- WirelessNetworks :: reset ( self ) ;
186-
187- Ok ( ( ) )
185+ fn reset ( & self , flag_changed : bool ) {
186+ WirelessNetworks :: reset ( self , flag_changed) ;
188187 }
189188
190189 fn load ( & self , data : & [ u8 ] ) -> Result < ( ) , Error > {
@@ -209,9 +208,7 @@ where
209208/// Used when the Matter stack is configured for Ethernet, as in that case
210209/// there is no network state that needs to be saved
211210impl NetworkPersist for ( ) {
212- fn reset ( & self ) -> Result < ( ) , Error > {
213- Ok ( ( ) )
214- }
211+ fn reset ( & self , _flag_changed : bool ) { }
215212
216213 fn load ( & self , _data : & [ u8 ] ) -> Result < ( ) , Error > {
217214 Ok ( ( ) )
0 commit comments