Cleanup AutoSync command (#36128)
diff --git a/examples/fabric-admin/commands/fabric-sync/Commands.h b/examples/fabric-admin/commands/fabric-sync/Commands.h
index a6bf1c2..47f7207 100644
--- a/examples/fabric-admin/commands/fabric-sync/Commands.h
+++ b/examples/fabric-admin/commands/fabric-sync/Commands.h
@@ -31,7 +31,6 @@
make_unique<FabricSyncAddLocalBridgeCommand>(credsIssuerConfig),
make_unique<FabricSyncRemoveLocalBridgeCommand>(credsIssuerConfig),
make_unique<FabricSyncDeviceCommand>(credsIssuerConfig),
- make_unique<FabricAutoSyncCommand>(credsIssuerConfig),
};
commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for fabric synchronization.");
diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp
index 879d28c..f10db13 100644
--- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp
+++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp
@@ -305,15 +305,3 @@
return CHIP_NO_ERROR;
}
-
-CHIP_ERROR FabricAutoSyncCommand::RunCommand(bool enableAutoSync)
-{
- DeviceMgr().EnableAutoSync(enableAutoSync);
-
- // print to console
- fprintf(stderr, "Auto Fabric Sync is %s.\n", enableAutoSync ? "enabled" : "disabled");
- fprintf(stderr,
- "WARNING: The auto-sync command is currently under development and may contain bugs. Use it at your own risk.\n");
-
- return CHIP_NO_ERROR;
-}
diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h
index 16ee40e..8d14529 100644
--- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h
+++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h
@@ -136,22 +136,3 @@
CHIP_ERROR RunCommand(chip::EndpointId remoteId);
};
-
-class FabricAutoSyncCommand : public CHIPCommand
-{
-public:
- FabricAutoSyncCommand(CredentialIssuerCommands * credIssuerCommands) : CHIPCommand("enable-auto-sync", credIssuerCommands)
- {
- AddArgument("state", 0, 1, &mEnableAutoSync, "Set to true to enable auto Fabric Sync, false to disable.");
- }
-
- /////////// CHIPCommand Interface /////////
- CHIP_ERROR RunCommand() override { return RunCommand(mEnableAutoSync); }
-
- chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(1); }
-
-private:
- bool mEnableAutoSync;
-
- CHIP_ERROR RunCommand(bool enableAutoSync);
-};
diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp
index 3bfd677..45a4094 100644
--- a/examples/fabric-admin/device_manager/DeviceManager.cpp
+++ b/examples/fabric-admin/device_manager/DeviceManager.cpp
@@ -351,14 +351,6 @@
{
// print to console
fprintf(stderr, "A new device is added on Endpoint: %u\n", endpoint);
-
- if (mAutoSyncEnabled)
- {
- StringBuilder<kMaxCommandSize> commandBuilder;
- commandBuilder.Add("fabricsync sync-device ");
- commandBuilder.AddFormat("%d", endpoint);
- PushCommand(commandBuilder.c_str());
- }
}
// Process removed endpoints
@@ -373,19 +365,6 @@
ChipLogProgress(NotSpecified, "No device on Endpoint: %u", endpoint);
continue;
}
-
- if (mAutoSyncEnabled)
- {
- NodeId nodeId = device->GetNodeId();
- if (PairingManager::Instance().UnpairDevice(nodeId) != CHIP_NO_ERROR)
- {
- ChipLogError(NotSpecified, "Failed to unpair device " ChipLogFormatX64, ChipLogValueX64(nodeId));
- }
- else
- {
- PairingManager::Instance().SetPairingDelegate(this);
- }
- }
}
}
diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h
index 43461f4..54d3bf9 100644
--- a/examples/fabric-admin/device_manager/DeviceManager.h
+++ b/examples/fabric-admin/device_manager/DeviceManager.h
@@ -69,14 +69,10 @@
void SetLocalBridgeSetupPinCode(uint32_t pinCode) { mLocalBridgeSetupPinCode = pinCode; }
void SetLocalBridgeNodeId(chip::NodeId nodeId) { mLocalBridgeNodeId = nodeId; }
- bool IsAutoSyncEnabled() const { return mAutoSyncEnabled; }
-
bool IsFabricSyncReady() const { return mRemoteBridgeNodeId != chip::kUndefinedNodeId; }
bool IsLocalBridgeReady() const { return mLocalBridgeNodeId != chip::kUndefinedNodeId; }
- void EnableAutoSync(bool state) { mAutoSyncEnabled = state; }
-
void AddSyncedDevice(const Device & device);
void RemoveSyncedDevice(chip::NodeId nodeId);
@@ -208,9 +204,8 @@
chip::NodeId mLocalBridgeNodeId = chip::kUndefinedNodeId;
std::set<Device> mSyncedDevices;
- bool mAutoSyncEnabled = false;
- bool mInitialized = false;
- uint64_t mRequestId = 0;
+ bool mInitialized = false;
+ uint64_t mRequestId = 0;
BridgeSubscription mBridgeSubscriber;
FabricSyncGetter mFabricSyncGetter;