ot::Dns::Client::BrowseResponse::GetServiceInfo() const method
Gets info for a service instance from a DNS browse (service instance enumeration) response. MUST only be used from `BrowseCallback`. A browse DNS response should include the SRV, TXT, and AAAA records for the service instances that are enumerated (note that it is a SHOULD and not a MUST requirement). This method tries to retrieve this info for a given service instance. - If no matching SRV record is found, `kErrorNotFound` is returned. - If a matching SRV record is found, @p aServiceInfo is updated returning `kErrorNone`. - If no matching TXT record is found, `mTxtDataSize` in @p aServiceInfo is set to zero. - If no matching AAAA record is found, `mHostAddress is set to all zero or unspecified address. - If there are multiple AAAA records for the host name `mHostAddress` is set to the first one. The other addresses can be retrieved using `GetHostAddress()` method.
Arguments
aInstanceLabel
The service instance label (MUST NOT be `nullptr`).
aServiceInfo
A `ServiceInfo` to output the service instance information.
Return value
kErrorNone The service instance info was read. @p aServiceInfo is updated. kErrorNotFound Could not find a matching SRV record for @p aInstanceLabel. kErrorNoBufs The host name and/or the TXT data could not fit in given buffers. kErrorParse Could not parse the records.
ot::Dns::Client::BrowseResponse::GetServiceInfo() const calls 2 functions:
![]()
ot::Dns::Client::BrowseResponse::GetServiceInfo() const
ot::Dns::Client::BrowseResponse::GetServiceInfo() const reads 5 variables and writes 1 variable:
![]()
ot::Dns::Client::BrowseResponse::GetServiceInfo() const