otDnsEncodeTxtData() function
Encodes a given list of TXT record entries (key/value pairs) into TXT data (following format specified by RFC 6763).
Arguments
aTxtEntries
Pointer to an array of `otDnsTxtEntry`.
aNumTxtEntries
Number of entries in @p aTxtEntries array.
aTxtData
A pointer to a buffer to output the encoded TXT data.
aTxtDataLength
On input, size of buffer @p aTxtData. On output, length of the encoded TXT data.
Return value
OT_ERROR_NONE Encoded TXT data successfully, @p aTxtData and @p aTxtDataLength are updated. OT_ERROR_INVALID_ARGS The @p aTxtEntries is not valid. OT_ERROR_NO_BUS Could not fit the encoded data in @p aTxtData buffer with its @p aTxtDataLength.
otDnsEncodeTxtData() reads 1 variable:
![]()
otDnsEncodeTxtData()