Skip to content

Commit

Permalink
Consistently use the "Clusters" namespace, not "clusters". (#10155)
Browse files Browse the repository at this point in the history
* Consistently use the "Clusters" namespace, not "clusters".

* Regenerate generated files.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 9, 2021
1 parent cb4ff7c commit 1559921
Show file tree
Hide file tree
Showing 29 changed files with 1,298 additions and 1,366 deletions.
4 changes: 2 additions & 2 deletions examples/ota-provider-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <unistd.h>

using chip::BitFlags;
using chip::app::clusters::OTAProviderDelegate;
using chip::app::Clusters::OTAProviderDelegate;
using chip::ArgParser::HelpOptions;
using chip::ArgParser::OptionDef;
using chip::ArgParser::OptionSet;
Expand Down Expand Up @@ -184,7 +184,7 @@ int main(int argc, char * argv[])
otaProvider.SetQueryImageBehavior(gQueryImageBehavior);
otaProvider.SetDelayedActionTimeSec(gDelayedActionTimeSec);

chip::app::clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, &otaProvider);
chip::app::Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, &otaProvider);

BitFlags<TransferControlFlags> bdxFlags;
bdxFlags.Set(TransferControlFlags::kReceiverDrive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using chip::ByteSpan;
using chip::Span;
using chip::app::CommandPathFlags;
using chip::app::CommandPathParams;
using chip::app::clusters::OTAProviderDelegate;
using chip::app::Clusters::OTAProviderDelegate;
using chip::TLV::ContextTag;
using chip::TLV::TLVWriter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
#include <app/Command.h>
#include <app/clusters/ota-provider/ota-provider-delegate.h>

using chip::app::clusters::OTAProviderDelegate;

/**
* A reference implementation for an OTA Provider. Includes a method for providing a path to a local OTA file to serve.
*/
class OTAProviderExample : public OTAProviderDelegate
class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate
{
public:
OTAProviderExample();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(EndpointId endpo
ByteSpan operationalDataset, uint64_t breadcrumb,
uint32_t timeoutMs)
{
EmberAfNetworkCommissioningError err = app::clusters::NetworkCommissioning::OnAddThreadNetworkCommandCallbackInternal(
EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnAddThreadNetworkCommandCallbackInternal(
nullptr, emberAfCurrentEndpoint(), operationalDataset, breadcrumb, timeoutMs);
emberAfSendImmediateDefaultResponse(err == EMBER_ZCL_NETWORK_COMMISSIONING_ERROR_SUCCESS ? EMBER_ZCL_STATUS_SUCCESS
: EMBER_ZCL_STATUS_FAILURE);
Expand All @@ -46,7 +46,7 @@ bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(EndpointId endpo
bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, ByteSpan ssid,
ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs)
{
EmberAfNetworkCommissioningError err = app::clusters::NetworkCommissioning::OnAddWiFiNetworkCommandCallbackInternal(
EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnAddWiFiNetworkCommandCallbackInternal(
nullptr, emberAfCurrentEndpoint(), ssid, credentials, breadcrumb, timeoutMs);
emberAfSendImmediateDefaultResponse(err == EMBER_ZCL_NETWORK_COMMISSIONING_ERROR_SUCCESS ? EMBER_ZCL_STATUS_SUCCESS
: EMBER_ZCL_STATUS_FAILURE);
Expand All @@ -56,7 +56,7 @@ bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(EndpointId endpoin
bool emberAfNetworkCommissioningClusterEnableNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj,
ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs)
{
EmberAfNetworkCommissioningError err = app::clusters::NetworkCommissioning::OnEnableNetworkCommandCallbackInternal(
EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnEnableNetworkCommandCallbackInternal(
nullptr, emberAfCurrentEndpoint(), networkID, breadcrumb, timeoutMs);
emberAfSendImmediateDefaultResponse(err == EMBER_ZCL_NETWORK_COMMISSIONING_ERROR_SUCCESS ? EMBER_ZCL_STATUS_SUCCESS
: EMBER_ZCL_STATUS_FAILURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@

using namespace chip;
using namespace chip::app;
using namespace chip::app::clusters;
using namespace chip::app::clusters::NetworkCommissioning;

namespace chip {
namespace app {
namespace clusters {
namespace Clusters {
namespace NetworkCommissioning {

constexpr uint8_t kMaxNetworkIDLen = 32;
Expand Down Expand Up @@ -291,6 +289,6 @@ EmberAfNetworkCommissioningError OnEnableNetworkCommandCallbackInternal(app::Com
}

} // namespace NetworkCommissioning
} // namespace clusters
} // namespace Clusters
} // namespace app
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace chip {
namespace app {
namespace clusters {
namespace Clusters {
namespace NetworkCommissioning {
EmberAfNetworkCommissioningError OnAddThreadNetworkCommandCallbackInternal(app::CommandHandler *, EndpointId,
ByteSpan operationalDataset, uint64_t breadcrumb,
Expand All @@ -37,6 +37,6 @@ EmberAfNetworkCommissioningError OnEnableNetworkCommandCallbackInternal(app::Com
uint64_t breadcrumb, uint32_t timeoutMs);
} // namespace NetworkCommissioning

} // namespace clusters
} // namespace Clusters
} // namespace app
} // namespace chip
5 changes: 3 additions & 2 deletions src/app/clusters/ota-provider/ota-provider-delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

namespace chip {
namespace app {
namespace clusters {
namespace Clusters {

// TODO: Should this be OTAProvider::Delegate?
/** @brief
* Defines methods for implementing application-specific logic for the OTA Provider Cluster.
*/
Expand All @@ -46,6 +47,6 @@ class OTAProviderDelegate
virtual ~OTAProviderDelegate() = default;
};

} // namespace clusters
} // namespace Clusters
} // namespace app
} // namespace chip
10 changes: 6 additions & 4 deletions src/app/clusters/ota-provider/ota-provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "ota-provider.h"

using namespace chip;
using chip::app::clusters::OTAProviderDelegate;
using chip::app::Clusters::OTAProviderDelegate;

namespace {
constexpr size_t kMaxMetadataLen = 512; // The maximum length of Metadata in any OTA Provider command
Expand Down Expand Up @@ -190,9 +190,10 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(chip::EndpointId

namespace chip {
namespace app {
namespace clusters {
namespace Clusters {
namespace OTAProvider {

void OTAProvider::SetDelegate(EndpointId endpoint, OTAProviderDelegate * delegate)
void SetDelegate(EndpointId endpoint, OTAProviderDelegate * delegate)
{
uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, ZCL_OTA_PROVIDER_CLUSTER_ID);
if (ep != 0xFFFF)
Expand All @@ -201,6 +202,7 @@ void OTAProvider::SetDelegate(EndpointId endpoint, OTAProviderDelegate * delegat
}
}

} // namespace clusters
} // namespace OTAProvider
} // namespace Clusters
} // namespace app
} // namespace chip
4 changes: 2 additions & 2 deletions src/app/clusters/ota-provider/ota-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace chip {
namespace app {
namespace clusters {
namespace Clusters {
namespace OTAProvider {

void SetDelegate(chip::EndpointId endpointId, OTAProviderDelegate * delegate);

}
} // namespace clusters
} // namespace Clusters
} // namespace app
} // namespace chip
Loading

0 comments on commit 1559921

Please sign in to comment.