Skip to content

Commit

Permalink
[OTA] Remove extraneous using-declaration of ProviderLocationType (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
carol-apple authored and pull[bot] committed Mar 14, 2022
1 parent feb55d5 commit 1099620
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/app/clusters/ota-requestor/GenericOTARequestorDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class GenericOTARequestorDriver : public OTARequestorDriver
void SendQueryImage() override;

// Returns the next available Provider location
bool DetermineProviderLocation(
app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type & providerLocation) override;
bool DetermineProviderLocation(ProviderLocationType & providerLocation) override;

protected:
void StartDefaultProviderTimer();
Expand All @@ -86,7 +85,6 @@ class GenericOTARequestorDriver : public OTARequestorDriver
uint32_t mOtaStartDelaySec = 0;
uint32_t mPeriodicQueryTimeInterval = (24 * 60 * 60); // Timeout for querying providers on the default OTA provider list

using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;
Optional<ProviderLocationType> mLastUsedProvider; // Provider location used for the last query or update
};

Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/ota-requestor/OTARequestor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe
// Clear all entries with the specified fabric index in the default OTA provider list
CHIP_ERROR ClearDefaultOtaProviderList(FabricIndex fabricIndex) override;

using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;
void SetCurrentProviderLocation(ProviderLocationType providerLocation) override
{
mProviderLocation.SetValue(providerLocation);
Expand Down
6 changes: 3 additions & 3 deletions src/app/clusters/ota-requestor/OTARequestorDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ enum class UpdateNotFoundReason
class OTARequestorDriver
{
public:
using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;

virtual ~OTARequestorDriver() = default;

/// Return if the device provides UI for asking a user for consent before downloading a software image
Expand Down Expand Up @@ -105,7 +107,6 @@ class OTARequestorDriver
/// Inform the driver that the device commissioning has completed
virtual void OTACommissioningCallback() = 0;

using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;
virtual void
/// Driver portion of the logic for processing the AnnounceOTAProviders command
ProcessAnnounceOTAProviders(const ProviderLocationType & providerLocation,
Expand All @@ -120,8 +121,7 @@ class OTARequestorDriver
// Driver picks the OTA Provider that should be used for the next query and update. The Provider is picked according to
// the driver's internal logic such as, for example, traversing the default providers list.
// Returns true if there is a Provider available for the next query, returns false otherwise.
virtual bool
DetermineProviderLocation(app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type & providerLocation) = 0;
virtual bool DetermineProviderLocation(ProviderLocationType & providerLocation) = 0;
};

} // namespace chip
5 changes: 2 additions & 3 deletions src/app/clusters/ota-requestor/OTARequestorInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ class ProviderLocationList
class OTARequestorInterface
{
public:
using OTAUpdateStateEnum = chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum;
using OTAUpdateStateEnum = chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum;
using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;

// Return value for various trigger-type APIs
enum OTATriggerResult
Expand Down Expand Up @@ -195,8 +196,6 @@ class OTARequestorInterface
// Clear all entries with the specified fabric index in the default OTA provider list
virtual CHIP_ERROR ClearDefaultOtaProviderList(FabricIndex fabricIndex) = 0;

using ProviderLocationType = app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type;

// Set the provider location to be used in the next query and OTA update process
virtual void SetCurrentProviderLocation(ProviderLocationType providerLocation) = 0;

Expand Down

0 comments on commit 1099620

Please sign in to comment.