Function otBorderAgentSetVendorTxtData

Source
pub unsafe extern "C" fn otBorderAgentSetVendorTxtData(
    aInstance: *mut otInstance,
    aVendorData: *const u8,
    aVendorDataLength: u16,
)
Expand description

Sets the vendor extra TXT data to be included when the Border Agent advertises the mDNS _meshcop._udp service.

Requires the OPENTHREAD_CONFIG_BORDER_AGENT_MESHCOP_SERVICE_ENABLE feature.

The provided @p aVendorData bytes are appended as they appear in the buffer to the end of the TXT data generated by the Border Agent itself, and are then included in the advertised mDNS _meshcop._udp service.

This function itself does not perform any validation of the format of the provided @p aVendorData. Therefore, the caller MUST ensure it is formatted properly. Per the Thread specification, vendor-specific Key-Value TXT data pairs use TXT keys starting with ā€˜v’. For example, vn for vendor name and generally v*.

The OpenThread stack will create and retain its own copy of the bytes in @p aVendorData. So, the buffer passed to this function does not need to persist beyond the scope of the call.

The vendor TXT data can be set at any time while the Border Agent is in any state. If there is a change from the previously set value, it will trigger an update of the registered mDNS service to advertise the new TXT data.

@param[in] aInstance The OpenThread instance. @param[in] aVendorData A pointer to the buffer containing the vendor TXT data. @param[in] aVendorDataLength The length of @p aVendorData in bytes.