From 81ecf85fa1147fa873aca8deeb89d2a3e21d4db2 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Sat, 2 Sep 2023 09:07:42 -0700 Subject: [PATCH] revent the adv proxy change --- src/sdp_proxy/advertising_proxy.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sdp_proxy/advertising_proxy.cpp b/src/sdp_proxy/advertising_proxy.cpp index 9f6ce494ad5..817786c0ede 100644 --- a/src/sdp_proxy/advertising_proxy.cpp +++ b/src/sdp_proxy/advertising_proxy.cpp @@ -342,10 +342,18 @@ Mdns::Publisher::TxtList AdvertisingProxy::MakeTxtList(const otSrpServerService { const uint8_t *txtData; uint16_t txtDataLength = 0; + otDnsTxtEntryIterator iterator; + otDnsTxtEntry txtEntry; Mdns::Publisher::TxtList txtList; txtData = otSrpServerServiceGetTxtData(aSrpService, &txtDataLength); - Mdns::Publisher::DecodeTxtData(txtList, txtData, txtDataLength); + + otDnsInitTxtEntryIterator(&iterator, txtData, txtDataLength); + + while (otDnsGetNextTxtEntry(&iterator, &txtEntry) == OT_ERROR_NONE) + { + txtList.emplace_back(txtEntry.mKey, txtEntry.mValue, txtEntry.mValueLength); + } return txtList; }