Skip to content

Commit

Permalink
Fix: Inserting VP into txtFields in Advertiser_ImplMinimalMdns (#7572)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon authored and pull[bot] committed Jun 25, 2021
1 parent b71120b commit 2331600
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/mdns/Advertiser_ImplMinimalMdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,15 @@ FullQName AdvertiserMinMdns::GetCommisioningTextEntries(const CommissionAdvertis
size_t numTxtFields = 0;

char txtVidPid[chip::Mdns::kKeyVendorProductMaxLength + 4];
if (params.GetProductId().HasValue())
if (params.GetProductId().HasValue() && params.GetVendorId().HasValue())
{
sprintf(txtVidPid, "VP=%d+%d", params.GetVendorId().Value(), params.GetProductId().Value());
txtFields[numTxtFields++] = txtVidPid;
}
else
else if (params.GetVendorId().HasValue())
{
sprintf(txtVidPid, "VP=%d", params.GetVendorId().Value());
txtFields[numTxtFields++] = txtVidPid;
}

char txtDeviceType[chip::Mdns::kKeyDeviceTypeMaxLength + 4];
Expand Down

0 comments on commit 2331600

Please sign in to comment.