Skip to content

Commit

Permalink
relocate/rename PersistentStorage to ExamplePersistentStorage (#23689)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yunhanw-google authored and pull[bot] committed Sep 1, 2023
1 parent 71d0380 commit 0e4315b
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static_library("chip-tool-utils") {
# TODO - enable CommissionedListCommand once DNS Cache is implemented
# "commands/pairing/CommissionedListCommand.cpp",
# "commands/pairing/CommissionedListCommand.h",
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
"${chip_root}/src/controller/ExamplePersistentStorage.h",
"commands/pairing/CloseSessionCommand.cpp",
"commands/pairing/CloseSessionCommand.h",
"commands/pairing/OpenCommissioningWindowCommand.cpp",
Expand All @@ -75,7 +77,6 @@ static_library("chip-tool-utils") {
"commands/payload/SetupPayloadParseCommand.cpp",
"commands/payload/SetupPayloadVerhoeff.cpp",
"commands/storage/StorageManagementCommand.cpp",
"config/PersistentStorage.cpp",
]

deps = []
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/clusters/ModelCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#ifdef CONFIG_USE_LOCAL_STORAGE
#include "../../config/PersistentStorage.h"
#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE

#include "../common/CHIPCommand.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#ifdef CONFIG_USE_LOCAL_STORAGE
#include "../../config/PersistentStorage.h"
#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE

#include "Command.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/common/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#ifdef CONFIG_USE_LOCAL_STORAGE
#include "../../config/PersistentStorage.h"
#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE

#include "Command.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/discover/DiscoverCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#pragma once

#include "../../config/PersistentStorage.h"
#include "../common/CHIPCommand.h"
#include <controller/ExamplePersistentStorage.h>

class DiscoverCommand : public CHIPCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#pragma once

#include "../../config/PersistentStorage.h"
#include "../common/Command.h"
#include <controller/ExamplePersistentStorage.h>

class CommissionedListCommand : public Command
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

#include "../../config/PersistentStorage.h"
#include <controller/ExamplePersistentStorage.h>

#include "StorageManagementCommand.h"

Expand Down
3 changes: 3 additions & 0 deletions examples/tv-casting-app/tv-casting-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ chip_data_model("tv-casting-common") {
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
"${chip_root}/examples/chip-tool/commands/common/Commands.h",
"${chip_root}/examples/chip-tool/commands/common/CredentialIssuerCommands.h",
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
"${chip_root}/src/controller/ExamplePersistentStorage.h",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp",
"commands/clusters/ModelCommand.cpp",
Expand Down Expand Up @@ -80,6 +82,7 @@ chip_data_model("tv-casting-common") {

deps = [
"${chip_root}/src/app/tests/suites/commands/interaction_model",
"${chip_root}/third_party/inipp",
"${chip_root}/third_party/jsoncpp",
]

Expand Down
2 changes: 2 additions & 0 deletions scripts/tools/check_includes_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,6 @@
# Not really for embedded consumers; uses std::queue to keep track
# of a list of discovered things.
'src/controller/SetUpCodePairer.h': {'queue'},

'src/controller/ExamplePersistentStorage.cpp': {'fstream'}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*
*/
#include "PersistentStorage.h"
#include "ExamplePersistentStorage.h"

#include <lib/core/CHIPEncoding.h>
#include <lib/support/IniEscaping.h>
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ shared_library("jni") {
"zap-generated/CHIPReadCallbacks.cpp",
"zap-generated/CHIPReadCallbacks.h",
]

if (build_java_matter_controller) {
sources += [
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
"${chip_root}/src/controller/ExamplePersistentStorage.h",
]
}
deps = [
"${chip_root}/src/controller/data_model",
"${chip_root}/src/controller/data_model:java-jni-sources",
Expand Down

0 comments on commit 0e4315b

Please sign in to comment.