Skip to content

Commit 669cd47

Browse files
relocate/rename PersistentStorage to ExamplePersistentStorage (#23689)
Java matter controller app test needs the example persistent storage, relocate the PersistentStorage from examples/chip-tool to src/controller, and put it nearby ExampleOperationalCredential
1 parent 2907759 commit 669cd47

File tree

12 files changed

+20
-9
lines changed

12 files changed

+20
-9
lines changed

examples/chip-tool/BUILD.gn

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ static_library("chip-tool-utils") {
6666
# TODO - enable CommissionedListCommand once DNS Cache is implemented
6767
# "commands/pairing/CommissionedListCommand.cpp",
6868
# "commands/pairing/CommissionedListCommand.h",
69+
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
70+
"${chip_root}/src/controller/ExamplePersistentStorage.h",
6971
"commands/pairing/CloseSessionCommand.cpp",
7072
"commands/pairing/CloseSessionCommand.h",
7173
"commands/pairing/OpenCommissioningWindowCommand.cpp",
@@ -75,7 +77,6 @@ static_library("chip-tool-utils") {
7577
"commands/payload/SetupPayloadParseCommand.cpp",
7678
"commands/payload/SetupPayloadVerhoeff.cpp",
7779
"commands/storage/StorageManagementCommand.cpp",
78-
"config/PersistentStorage.cpp",
7980
]
8081

8182
deps = []

examples/chip-tool/commands/clusters/ModelCommand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#pragma once
2020

2121
#ifdef CONFIG_USE_LOCAL_STORAGE
22-
#include "../../config/PersistentStorage.h"
22+
#include <controller/ExamplePersistentStorage.h>
2323
#endif // CONFIG_USE_LOCAL_STORAGE
2424

2525
#include "../common/CHIPCommand.h"

examples/chip-tool/commands/common/CHIPCommand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#pragma once
2020

2121
#ifdef CONFIG_USE_LOCAL_STORAGE
22-
#include "../../config/PersistentStorage.h"
22+
#include <controller/ExamplePersistentStorage.h>
2323
#endif // CONFIG_USE_LOCAL_STORAGE
2424

2525
#include "Command.h"

examples/chip-tool/commands/common/Commands.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#pragma once
2020

2121
#ifdef CONFIG_USE_LOCAL_STORAGE
22-
#include "../../config/PersistentStorage.h"
22+
#include <controller/ExamplePersistentStorage.h>
2323
#endif // CONFIG_USE_LOCAL_STORAGE
2424

2525
#include "Command.h"

examples/chip-tool/commands/discover/DiscoverCommand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#pragma once
2020

21-
#include "../../config/PersistentStorage.h"
2221
#include "../common/CHIPCommand.h"
22+
#include <controller/ExamplePersistentStorage.h>
2323

2424
class DiscoverCommand : public CHIPCommand
2525
{

examples/chip-tool/commands/pairing/CommissionedListCommand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#pragma once
2020

21-
#include "../../config/PersistentStorage.h"
2221
#include "../common/Command.h"
22+
#include <controller/ExamplePersistentStorage.h>
2323

2424
class CommissionedListCommand : public Command
2525
{

examples/chip-tool/commands/storage/StorageManagementCommand.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*/
1818

19-
#include "../../config/PersistentStorage.h"
19+
#include <controller/ExamplePersistentStorage.h>
2020

2121
#include "StorageManagementCommand.h"
2222

examples/tv-casting-app/tv-casting-common/BUILD.gn

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ chip_data_model("tv-casting-common") {
4343
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
4444
"${chip_root}/examples/chip-tool/commands/common/Commands.h",
4545
"${chip_root}/examples/chip-tool/commands/common/CredentialIssuerCommands.h",
46+
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
47+
"${chip_root}/src/controller/ExamplePersistentStorage.h",
4648
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
4749
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp",
4850
"commands/clusters/ModelCommand.cpp",
@@ -80,6 +82,7 @@ chip_data_model("tv-casting-common") {
8082

8183
deps = [
8284
"${chip_root}/src/app/tests/suites/commands/interaction_model",
85+
"${chip_root}/third_party/inipp",
8386
"${chip_root}/third_party/jsoncpp",
8487
]
8588

scripts/tools/check_includes_config.py

+2
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,6 @@
152152
# Not really for embedded consumers; uses std::queue to keep track
153153
# of a list of discovered things.
154154
'src/controller/SetUpCodePairer.h': {'queue'},
155+
156+
'src/controller/ExamplePersistentStorage.cpp': {'fstream'}
155157
}

examples/chip-tool/config/PersistentStorage.cpp src/controller/ExamplePersistentStorage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*
1717
*/
18-
#include "PersistentStorage.h"
18+
#include "ExamplePersistentStorage.h"
1919

2020
#include <lib/core/CHIPEncoding.h>
2121
#include <lib/support/IniEscaping.h>

src/controller/java/BUILD.gn

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ shared_library("jni") {
4949
"zap-generated/CHIPReadCallbacks.cpp",
5050
"zap-generated/CHIPReadCallbacks.h",
5151
]
52-
52+
if (build_java_matter_controller) {
53+
sources += [
54+
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
55+
"${chip_root}/src/controller/ExamplePersistentStorage.h",
56+
]
57+
}
5358
deps = [
5459
"${chip_root}/src/controller/data_model",
5560
"${chip_root}/src/controller/data_model:java-jni-sources",

0 commit comments

Comments
 (0)