Skip to content

Commit

Permalink
[BouffaloLab] Add factory string data terminator
Browse files Browse the repository at this point in the history
  • Loading branch information
shchen-Lab committed Oct 24, 2023
1 parent 7287731 commit 3d862fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/platform/bouffalolab/common/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize)
len = mfd_getVendorName(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand Down Expand Up @@ -452,6 +453,7 @@ CHIP_ERROR FactoryDataProvider::GetProductName(char * buf, size_t bufSize)
len = mfd_getProductName(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand Down Expand Up @@ -498,6 +500,7 @@ CHIP_ERROR FactoryDataProvider::GetPartNumber(char * buf, size_t bufSize)
len = mfd_getPartNumber(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand All @@ -519,6 +522,7 @@ CHIP_ERROR FactoryDataProvider::GetProductURL(char * buf, size_t bufSize)
len = mfd_getProductUrl(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand All @@ -540,6 +544,7 @@ CHIP_ERROR FactoryDataProvider::GetProductLabel(char * buf, size_t bufSize)
len = mfd_getProductLabel(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand All @@ -561,6 +566,7 @@ CHIP_ERROR FactoryDataProvider::GetSerialNumber(char * buf, size_t bufSize)
len = mfd_getSerialNumber(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand Down Expand Up @@ -637,10 +643,10 @@ CHIP_ERROR FactoryDataProvider::GetHardwareVersionString(char * buf, size_t bufS
{
#if CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE
int len = 0;

len = mfd_getHardwareVersionString(buf, bufSize);
if (len > 0)
{
buf[len]=0;
return CHIP_NO_ERROR;
}
else if (0 == len)
Expand Down

0 comments on commit 3d862fd

Please sign in to comment.