Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and harimau-qirex committed Oct 18, 2021
1 parent 8f84225 commit 5025075
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 44 deletions.
80 changes: 40 additions & 40 deletions src/include/platform/ConfigurationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,57 +68,57 @@ class ConfigurationManager
kMaxMACAddressLength = 8,
};

virtual CHIP_ERROR GetVendorName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetVendorId(uint16_t & vendorId) = 0;
virtual CHIP_ERROR GetProductName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetProductId(uint16_t & productId) = 0;
virtual CHIP_ERROR GetProductRevisionString(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetProductRevision(uint16_t & productRev) = 0;
virtual CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize, size_t & serialNumLen) = 0;
virtual CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) = 0;
virtual CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) = 0;
virtual CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) = 0;
virtual CHIP_ERROR GetVendorName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetVendorId(uint16_t & vendorId) = 0;
virtual CHIP_ERROR GetProductName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetProductId(uint16_t & productId) = 0;
virtual CHIP_ERROR GetProductRevisionString(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetProductRevision(uint16_t & productRev) = 0;
virtual CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize, size_t & serialNumLen) = 0;
virtual CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) = 0;
virtual CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) = 0;
virtual CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) = 0;
virtual CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth) = 0;
virtual CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetFirmwareRevision(uint32_t & firmwareRev) = 0;
virtual CHIP_ERROR GetSetupPinCode(uint32_t & setupPinCode) = 0;
virtual CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) = 0;
virtual CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetFirmwareRevision(uint32_t & firmwareRev) = 0;
virtual CHIP_ERROR GetSetupPinCode(uint32_t & setupPinCode) = 0;
virtual CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) = 0;
#if CHIP_ENABLE_ROTATING_DEVICE_ID
// Lifetime counter is monotonic counter that is incremented only in the case of a factory reset
virtual CHIP_ERROR GetLifetimeCounter(uint16_t & lifetimeCounter) = 0;
#endif
virtual CHIP_ERROR GetRegulatoryLocation(uint32_t & location) = 0;
virtual CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) = 0;
virtual CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) = 0;
virtual CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) = 0;
virtual CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf) = 0;
virtual CHIP_ERROR StorePrimary802154MACAddress(const uint8_t * buf) = 0;
virtual CHIP_ERROR GetRegulatoryLocation(uint32_t & location) = 0;
virtual CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) = 0;
virtual CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb) = 0;
virtual CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) = 0;
virtual CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf) = 0;
virtual CHIP_ERROR StorePrimary802154MACAddress(const uint8_t * buf) = 0;
virtual CHIP_ERROR StoreManufacturingDate(const char * mfgDate, size_t mfgDateLen) = 0;
virtual CHIP_ERROR StoreProductRevision(uint16_t productRev) = 0;
virtual CHIP_ERROR StoreSetupPinCode(uint32_t setupPinCode) = 0;
virtual CHIP_ERROR StoreSetupDiscriminator(uint16_t setupDiscriminator) = 0;
virtual CHIP_ERROR StoreRegulatoryLocation(uint32_t location) = 0;
virtual CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) = 0;
virtual CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) = 0;
virtual CHIP_ERROR StoreProductRevision(uint16_t productRev) = 0;
virtual CHIP_ERROR StoreSetupPinCode(uint32_t setupPinCode) = 0;
virtual CHIP_ERROR StoreSetupDiscriminator(uint16_t setupDiscriminator) = 0;
virtual CHIP_ERROR StoreRegulatoryLocation(uint32_t location) = 0;
virtual CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) = 0;
virtual CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb) = 0;

virtual CHIP_ERROR GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) = 0;

#if !defined(NDEBUG)
virtual CHIP_ERROR RunUnitTests() = 0;
#endif

virtual bool IsFullyProvisioned() = 0;
virtual bool IsFullyProvisioned() = 0;
virtual void InitiateFactoryReset() = 0;

virtual void LogDeviceConfig() = 0;

virtual bool IsCommissionableDeviceTypeEnabled() = 0;
virtual CHIP_ERROR GetDeviceType(uint16_t & deviceType) = 0;
virtual bool IsCommissionableDeviceNameEnabled() = 0;
virtual CHIP_ERROR GetDeviceName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetInitialPairingHint(uint16_t & pairingHint) = 0;
virtual CHIP_ERROR GetInitialPairingInstruction(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetSecondaryPairingHint(uint16_t & pairingHint) = 0;
virtual bool IsCommissionableDeviceTypeEnabled() = 0;
virtual CHIP_ERROR GetDeviceType(uint16_t & deviceType) = 0;
virtual bool IsCommissionableDeviceNameEnabled() = 0;
virtual CHIP_ERROR GetDeviceName(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetInitialPairingHint(uint16_t & pairingHint) = 0;
virtual CHIP_ERROR GetInitialPairingInstruction(char * buf, size_t bufSize) = 0;
virtual CHIP_ERROR GetSecondaryPairingHint(uint16_t & pairingHint) = 0;
virtual CHIP_ERROR GetSecondaryPairingInstruction(char * buf, size_t bufSize) = 0;

protected:
Expand All @@ -133,15 +133,15 @@ class ConfigurationManager
friend CHIP_ERROR(::chip::Platform::PersistedStorage::Read)(::chip::Platform::PersistedStorage::Key key, uint32_t & value);
friend CHIP_ERROR(::chip::Platform::PersistedStorage::Write)(::chip::Platform::PersistedStorage::Key key, uint32_t value);

virtual CHIP_ERROR Init() = 0;
virtual bool CanFactoryReset() = 0;
virtual CHIP_ERROR GetFailSafeArmed(bool & val) = 0;
virtual CHIP_ERROR SetFailSafeArmed(bool val) = 0;
virtual CHIP_ERROR Init() = 0;
virtual bool CanFactoryReset() = 0;
virtual CHIP_ERROR GetFailSafeArmed(bool & val) = 0;
virtual CHIP_ERROR SetFailSafeArmed(bool val) = 0;
virtual CHIP_ERROR ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value) = 0;
virtual CHIP_ERROR WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value) = 0;
virtual CHIP_ERROR WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value) = 0;

// Construction/destruction limited to subclasses.
ConfigurationManager() = default;
ConfigurationManager() = default;
virtual ~ConfigurationManager() = default;

// No copy, move or assignment.
Expand Down
3 changes: 1 addition & 2 deletions src/platform/Zephyr/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ inline bool ConfigurationManagerImpl::_CanFactoryReset()
return true;
}

inline CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key,
uint32_t & value)
inline CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value)
{
return ReadConfigValueCounter(key, value);
}
Expand Down
10 changes: 8 additions & 2 deletions src/platform/fake/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class ConfigurationManagerImpl final : public ConfigurationManager
CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR StorePrimary802154MACAddress(const uint8_t * buf) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth) override
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}
CHIP_ERROR StoreManufacturingDate(const char * mfgDate, size_t mfgDateLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetSetupPinCode(uint32_t & setupPinCode) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR StoreSetupPinCode(uint32_t setupPinCode) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
Expand All @@ -58,7 +61,10 @@ class ConfigurationManagerImpl final : public ConfigurationManager
#endif
CHIP_ERROR GetFailSafeArmed(bool & val) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR SetFailSafeArmed(bool val) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) override
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}
bool IsCommissionableDeviceTypeEnabled() override { return false; }
CHIP_ERROR GetDeviceType(uint16_t & deviceType) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
bool IsCommissionableDeviceNameEnabled() override { return false; }
Expand Down

0 comments on commit 5025075

Please sign in to comment.