diff --git a/src/sdp_proxy/advertising_proxy.cpp b/src/sdp_proxy/advertising_proxy.cpp index d254ed0dbb6..817786c0ede 100644 --- a/src/sdp_proxy/advertising_proxy.cpp +++ b/src/sdp_proxy/advertising_proxy.cpp @@ -247,18 +247,16 @@ otbrError AdvertisingProxy::PublishHostAndItsServices(const otSrpServerHost *aHo aUpdate->mCallbackCount++; aUpdate->mHostName = hostName; service = nullptr; - while ((service = otSrpServerHostFindNextService(aHost, service, OT_SRP_SERVER_FLAGS_BASE_TYPE_SERVICE_ONLY, - /* aServiceName */ nullptr, /* aInstanceName */ nullptr))) + while ((service = otSrpServerHostGetNextService(aHost, service)) != nullptr) { aUpdate->mCallbackCount++; } } service = nullptr; - while ((service = otSrpServerHostFindNextService(aHost, service, OT_SRP_SERVER_FLAGS_BASE_TYPE_SERVICE_ONLY, - /* aServiceName */ nullptr, /* aInstanceName */ nullptr))) + while ((service = otSrpServerHostGetNextService(aHost, service)) != nullptr) { - std::string fullServiceName = otSrpServerServiceGetFullName(service); + std::string fullServiceName = otSrpServerServiceGetInstanceName(service); std::string serviceName; std::string serviceType; std::string serviceDomain; @@ -362,27 +360,19 @@ Mdns::Publisher::TxtList AdvertisingProxy::MakeTxtList(const otSrpServerService Mdns::Publisher::SubTypeList AdvertisingProxy::MakeSubTypeList(const otSrpServerService *aSrpService) { - const otSrpServerHost *host = otSrpServerServiceGetHost(aSrpService); - const char *instanceName = otSrpServerServiceGetInstanceName(aSrpService); - const otSrpServerService *subService = nullptr; Mdns::Publisher::SubTypeList subTypeList; - while ((subService = otSrpServerHostFindNextService( - host, subService, (OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE), - /* aServiceName */ nullptr, instanceName)) != nullptr) + for (uint16_t index = 0;; index++) { - char subLabel[OT_DNS_MAX_LABEL_SIZE]; + const char *subTypeName = otSrpServerServiceGetSubTypeServiceNameAt(aSrpService, index); + char subLabel[OT_DNS_MAX_LABEL_SIZE]; - if (otSrpServerServiceGetServiceSubTypeLabel(subService, subLabel, sizeof(subLabel)) == OT_ERROR_NONE) - { - subTypeList.emplace_back(subLabel); - } - else - { - otbrLogWarning("Failed to retrieve subtype of SRP service: %s", otSrpServerServiceGetFullName(aSrpService)); - } + VerifyOrExit(subTypeName != nullptr); + SuccessOrExit(otSrpServerParseSubTypeServiceName(subTypeName, subLabel, sizeof(subLabel))); + subTypeList.emplace_back(subLabel); } +exit: return subTypeList; } diff --git a/third_party/openthread/repo b/third_party/openthread/repo index e6df00dd66e..ec93c24007c 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit e6df00dd66e245a54551d53512dd6e88237abcca +Subproject commit ec93c24007ca35bddfefd151ea46e0fe6983ddf6