From eac6367d8c7910e9b13294b5bce443b114e6dd9a Mon Sep 17 00:00:00 2001 From: Sharad Binjola Date: Sun, 13 Jun 2021 06:47:20 +0000 Subject: [PATCH] Fix: Inserting VP into txtFields in Advertiser_ImplMinimalMdns --- src/lib/mdns/Advertiser_ImplMinimalMdns.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp index 2bc83bf49799d9..83374ac6788ead 100644 --- a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp +++ b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp @@ -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];