Skip to content

Commit

Permalink
Merge bc98e70 into ae3d1ce
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoletta-amzn authored Jan 11, 2024
2 parents ae3d1ce + bc98e70 commit 3999491
Show file tree
Hide file tree
Showing 29 changed files with 133 additions and 18 deletions.
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class ExampleDeviceInstanceInfoProvider : public DeviceInstanceInfoProvider
public:
void Init(DeviceInstanceInfoProvider * defaultProvider) { mDefaultProvider = defaultProvider; }

CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override { return mDefaultProvider->GetDeviceName(deviceNameSpan); }
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override { return mDefaultProvider->GetVendorName(buf, bufSize); }
CHIP_ERROR GetVendorId(uint16_t & vendorId) override { return mDefaultProvider->GetVendorId(vendorId); }
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override { return mDefaultProvider->GetProductName(buf, bufSize); }
Expand Down
22 changes: 18 additions & 4 deletions src/app/server/Dnssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ namespace chip {
namespace app {
namespace {

static_assert(ConfigurationManager::kMaxDeviceNameLen == Dnssd::kKeyDeviceNameMaxLength,
"Max device name length constants are not matching: ConfigurationManager::kMaxDeviceNameLen and "
"Dnssd::kKeyDeviceNameMaxLength");

void OnPlatformEvent(const DeviceLayer::ChipDeviceEvent * event)
{
switch (event->Type)
Expand Down Expand Up @@ -251,11 +255,21 @@ CHIP_ERROR DnssdServer::Advertise(bool commissionableNode, chip::Dnssd::Commissi
advertiseParameters.SetDeviceType(chip::Optional<uint32_t>::Value(val32));
}

char deviceName[chip::Dnssd::kKeyDeviceNameMaxLength + 1];
if (DeviceLayer::ConfigurationMgr().IsCommissionableDeviceNameEnabled() &&
DeviceLayer::ConfigurationMgr().GetCommissionableDeviceName(deviceName, sizeof(deviceName)) == CHIP_NO_ERROR)
char deviceName[Dnssd::kKeyDeviceNameMaxLength + 1];
MutableCharSpan deviceNameSpan(deviceName, Dnssd::kKeyDeviceNameMaxLength);
if (DeviceLayer::ConfigurationMgr().IsCommissionableDeviceNameEnabled())
{
advertiseParameters.SetDeviceName(chip::Optional<const char *>::Value(deviceName));
CHIP_ERROR err;
if ((err = DeviceLayer::ConfigurationMgr().GetCommissionableDeviceName(deviceNameSpan)) == CHIP_NO_ERROR)
{
// Appending a null terminator since SetDeviceName expects a null terminated string
deviceName[deviceNameSpan.size()] = '\0';
advertiseParameters.SetDeviceName(Optional<const char *>::Value(deviceName));
}
else
{
ChipLogError(Discovery, "Failed to read commissionableDeviceName %" CHIP_ERROR_FORMAT, err.Format());
}
}

advertiseParameters.SetLocalMRPConfig(GetLocalMRPConfig()).SetTcpSupported(Optional<bool>(INET_CONFIG_ENABLE_TCP_ENDPOINT));
Expand Down
18 changes: 10 additions & 8 deletions src/include/platform/ConfigurationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ConfigurationManager

enum
{
kMaxDeviceNameLen = 32,
kMaxVendorNameLength = 32,
kMaxProductNameLength = 32,
kMaxLocationLength = 2,
Expand Down Expand Up @@ -141,14 +142,15 @@ class ConfigurationManager

virtual void LogDeviceConfig() = 0;

virtual bool IsCommissionableDeviceTypeEnabled() = 0;
virtual CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) = 0;
virtual bool IsCommissionableDeviceNameEnabled() = 0;
virtual CHIP_ERROR GetCommissionableDeviceName(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;
virtual bool IsCommissionableDeviceTypeEnabled() = 0;
virtual CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) = 0;
virtual bool IsCommissionableDeviceNameEnabled() = 0;
// deviceNameSpan gets resized to the actual size of the character data
virtual CHIP_ERROR GetCommissionableDeviceName(MutableCharSpan & deviceNameSpan) = 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;

virtual CHIP_ERROR GetLocationCapability(uint8_t & location);

Expand Down
10 changes: 10 additions & 0 deletions src/include/platform/DeviceInstanceInfoProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class DeviceInstanceInfoProvider
DeviceInstanceInfoProvider() = default;
virtual ~DeviceInstanceInfoProvider() = default;

/**
* @brief Obtain the Device Name from the device's factory data.
*
* @param[out] deviceName Buffer to copy the name into. On success, will be
resized to the actual size of the name.
* @returns CHIP_NO_ERROR on success, or another CHIP_ERROR from the underlying implementation
* if access fails.
*/
virtual CHIP_ERROR GetDeviceName(MutableCharSpan & deviceName) = 0;

/**
* @brief Obtain the Vendor Name from the device's factory data.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class GenericConfigurationManagerImpl : public ConfigurationManager
bool IsCommissionableDeviceTypeEnabled() override;
CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) override;
bool IsCommissionableDeviceNameEnabled() override;
CHIP_ERROR GetCommissionableDeviceName(char * buf, size_t bufSize) override;
CHIP_ERROR GetCommissionableDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetInitialPairingHint(uint16_t & pairingHint) override;
CHIP_ERROR GetInitialPairingInstruction(char * buf, size_t bufSize) override;
CHIP_ERROR GetSecondaryPairingHint(uint16_t & pairingHint) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,9 @@ bool GenericConfigurationManagerImpl<ConfigClass>::IsCommissionableDeviceNameEna
}

template <class ConfigClass>
CHIP_ERROR GenericConfigurationManagerImpl<ConfigClass>::GetCommissionableDeviceName(char * buf, size_t bufSize)
CHIP_ERROR GenericConfigurationManagerImpl<ConfigClass>::GetCommissionableDeviceName(MutableCharSpan & deviceNameSpan)
{
ReturnErrorCodeIf(bufSize < sizeof(CHIP_DEVICE_CONFIG_DEVICE_NAME), CHIP_ERROR_BUFFER_TOO_SMALL);
strcpy(buf, CHIP_DEVICE_CONFIG_DEVICE_NAME);
return CHIP_NO_ERROR;
return GetDeviceInstanceInfoProvider()->GetDeviceName(deviceNameSpan);
}

template <class ConfigClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class GenericDeviceInstanceInfoProvider : public DeviceInstanceInfoProvider
mGenericConfigManager(configManager)
{}

CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ namespace chip {
namespace DeviceLayer {
namespace Internal {

template <class ConfigClass>
CHIP_ERROR GenericDeviceInstanceInfoProvider<ConfigClass>::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
constexpr char deviceName[] = CHIP_DEVICE_CONFIG_DEVICE_NAME;

return CopyCharSpanToMutableCharSpan(CharSpan::fromCharString(deviceName), deviceNameSpan);
}

template <class ConfigClass>
CHIP_ERROR GenericDeviceInstanceInfoProvider<ConfigClass>::GetVendorId(uint16_t & vendorId)
{
Expand Down
5 changes: 5 additions & 0 deletions src/platform/Ameba/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode)
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
{
CHIP_ERROR err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
Expand Down
1 change: 1 addition & 0 deletions src/platform/Ameba/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia
CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override;

// ===== Members functions that implement the DeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
1 change: 1 addition & 0 deletions src/platform/android/AndroidConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const char AndroidConfig::kConfigNamespace_ChipCounters[] = "chip-counters";

// Keys stored in the Chip-factory namespace
const AndroidConfig::Key AndroidConfig::kConfigKey_SerialNum = { kConfigNamespace_ChipFactory, "serial-num" };
const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceName = { kConfigNamespace_ChipFactory, "device-name" };
const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceId = { kConfigNamespace_ChipFactory, "device-id" };
const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" };
const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" };
Expand Down
1 change: 1 addition & 0 deletions src/platform/android/AndroidConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AndroidConfig

// Key definitions for well-known keys.
static const Key kConfigKey_SerialNum;
static const Key kConfigKey_MfrDeviceName;
static const Key kConfigKey_MfrDeviceId;
static const Key kConfigKey_MfrDeviceCert;
static const Key kConfigKey_MfrDeviceICACerts;
Expand Down
23 changes: 23 additions & 0 deletions src/platform/android/DeviceInstanceInfoProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ CHIP_ERROR DeviceInstanceInfoProviderImpl::GetProductLabel(char * buf, size_t bu
return Internal::AndroidConfig::ReadConfigValueStr(Internal::AndroidConfig::kConfigKey_ProductLabel, buf, bufSize, dateLen);
}

CHIP_ERROR DeviceInstanceInfoProviderImpl::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
CHIP_ERROR err;
size_t deviceNameSize = 0;
char androidDeviceName[ConfigurationManager::kMaxDeviceNameLen];

err = Internal::AndroidConfig::ReadConfigValueStr(Internal::AndroidConfig::kConfigKey_MfrDeviceName, androidDeviceName,
sizeof(androidDeviceName), deviceNameSize);

if (err == CHIP_NO_ERROR)
{
ReturnErrorCodeIf(deviceNameSpan.size() < deviceNameSize, CHIP_ERROR_BUFFER_TOO_SMALL);
memcpy(deviceNameSpan.data(), androidDeviceName, deviceNameSize);
deviceNameSpan.reduce_size(deviceNameSize);
return CHIP_NO_ERROR;
}
if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND)
{
return CopyCharSpanToMutableCharSpan(CharSpan::fromCharString(CHIP_DEVICE_CONFIG_DEVICE_NAME), deviceNameSpan);
}
return err;
}

CHIP_ERROR DeviceInstanceInfoProviderImpl::GetProductName(char * buf, size_t bufSize)
{
CHIP_ERROR err;
Expand Down
1 change: 1 addition & 0 deletions src/platform/android/DeviceInstanceInfoProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace DeviceLayer {
class DeviceInstanceInfoProviderImpl : public Internal::GenericDeviceInstanceInfoProvider<Internal::AndroidConfig>
{
public:
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
CHIP_ERROR GetProductId(uint16_t & productId) override;
CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public interface ConfigurationManager {

// Keys stored in the Chip-factory namespace
String kConfigKey_SerialNum = "serial-num";
String kConfigKey_MfrDeviceName = "device-name";
String kConfigKey_MfrDeviceId = "device-id";
String kConfigKey_MfrDeviceCert = "device-cert";
String kConfigKey_MfrDeviceICACerts = "device-ca-certs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ public String readConfigValueStr(String namespace, String name)
String key = getKey(namespace, name);

switch (key) {
/**
* Human readable name of the device name.
*
* <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
*/
case kConfigNamespace_ChipFactory + ":" + kConfigKey_MfrDeviceName:
return "TEST_ANDROID_DEVICE_NAME";

/**
* Human readable name of the device model. return a different value than
* src/include/platform/CHIPDeviceConfig.h for debug
Expand Down
5 changes: 5 additions & 0 deletions src/platform/bouffalolab/common/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode)
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
{
#if CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE
Expand Down
1 change: 1 addition & 0 deletions src/platform/bouffalolab/common/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia
CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override;

// ===== Members functions that implement the DeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/fake/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ConfigurationManagerImpl : public ConfigurationManager
bool IsCommissionableDeviceTypeEnabled() override { return false; }
CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
bool IsCommissionableDeviceNameEnabled() override { return false; }
CHIP_ERROR GetCommissionableDeviceName(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetCommissionableDeviceName(MutableCharSpan & deviceNameSpan) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetInitialPairingHint(uint16_t & pairingHint) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetInitialPairingInstruction(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR GetSecondaryPairingHint(uint16_t & pairingHint) override { return CHIP_ERROR_NOT_IMPLEMENTED; }
Expand Down
6 changes: 6 additions & 0 deletions src/platform/nrfconnect/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ CHIP_ERROR FactoryDataProvider<FlashFactoryData>::SetSetupPasscode(uint32_t setu
return CHIP_ERROR_NOT_IMPLEMENTED;
}

template <class FlashFactoryData>
CHIP_ERROR FactoryDataProvider<FlashFactoryData>::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

template <class FlashFactoryData>
CHIP_ERROR FactoryDataProvider<FlashFactoryData>::GetVendorName(char * buf, size_t bufSize)
{
Expand Down
1 change: 1 addition & 0 deletions src/platform/nrfconnect/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia
CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override;

// ===== Members functions that implement the DeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
6 changes: 6 additions & 0 deletions src/platform/nxp/k32w/common/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ FactoryDataProvider::FactoryDataProvider()
maxLengths[FactoryDataId::kVidId] = sizeof(uint16_t);
maxLengths[FactoryDataId::kPidId] = sizeof(uint16_t);
maxLengths[FactoryDataId::kCertDeclarationId] = Credentials::kMaxCMSSignedCDMessage;
maxLengths[FactoryDataId::kDeviceName] = ConfigurationManager::kMaxDeviceNameLen;
maxLengths[FactoryDataId::kVendorNameId] = ConfigurationManager::kMaxVendorNameLength;
maxLengths[FactoryDataId::kProductNameId] = ConfigurationManager::kMaxProductNameLength;
maxLengths[FactoryDataId::kSerialNumberId] = ConfigurationManager::kMaxSerialNumberLength;
Expand Down Expand Up @@ -228,6 +229,11 @@ CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode)
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
{
uint16_t length = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/platform/nxp/k32w/common/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class FactoryDataProvider : public DeviceInstanceInfoProvider,
kVidId,
kPidId,
kCertDeclarationId,
kDeviceNameId,
kVendorNameId,
kProductNameId,
kSerialNumberId,
Expand Down Expand Up @@ -130,6 +131,7 @@ class FactoryDataProvider : public DeviceInstanceInfoProvider,
CHIP_ERROR SignWithDeviceAttestationKey(const ByteSpan & messageToSign, MutableByteSpan & outSignBuffer) override;

// ===== Members functions that implement the GenericDeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
5 changes: 5 additions & 0 deletions src/platform/nxp/mw320/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode)
}

#if CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER
CHIP_ERROR FactoryDataProvider::GetDeviceName(MutableCharSpan & devicenameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
Expand Down
1 change: 1 addition & 0 deletions src/platform/nxp/mw320/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class FactoryDataProvider : public CommissionableDataProvider,

#if CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER
// ===== Members functions that implement the GenericDeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
5 changes: 5 additions & 0 deletions src/platform/qpg/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ CHIP_ERROR FactoryDataProvider::GetProductLabel(char * buf, size_t bufSize)
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR FactoryDataProvider::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
{
qvStatus_t status;
Expand Down
1 change: 1 addition & 0 deletions src/platform/qpg/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia
CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override;

// ===== Members functions that implement the DeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down
6 changes: 6 additions & 0 deletions src/platform/telink/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ CHIP_ERROR FactoryDataProvider<FlashFactoryData>::SetSetupPasscode(uint32_t setu
return CHIP_ERROR_NOT_IMPLEMENTED;
}

template <class FlashFactoryData>
CHIP_ERROR FactoryDataProvider<FlashFactoryData>::GetDeviceName(MutableCharSpan & deviceNameSpan)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

template <class FlashFactoryData>
CHIP_ERROR FactoryDataProvider<FlashFactoryData>::GetVendorName(char * buf, size_t bufSize)
{
Expand Down
1 change: 1 addition & 0 deletions src/platform/telink/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia
CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override;

// ===== Members functions that implement the DeviceInstanceInfoProvider
CHIP_ERROR GetDeviceName(MutableCharSpan & deviceNameSpan) override;
CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override;
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
Expand Down

0 comments on commit 3999491

Please sign in to comment.