pub unsafe extern "C" fn otSrpClientAddService(
aInstance: *mut otInstance,
aService: *mut otSrpClientService,
) -> otError
Expand description
Adds a service to be registered with server.
After a successful call to this function, otSrpClientCallback
will be called to report the status of the service
addition/registration with SRP server.
The otSrpClientService
instance being pointed to by @p aService MUST persist and remain unchanged after returning
from this function (with OT_ERROR_NONE
). OpenThread will save the pointer to the service instance.
The otSrpClientService
instance is not longer tracked by OpenThread and can be reclaimed only when
- It is removed explicitly by a call to
otSrpClientRemoveService()
or removed along with other services by a call tootSrpClientRemoveHostAndServices() and only after the
otSrpClientCallback` is called indicating the service was removed. Or, - A call to
otSrpClientClearHostAndServices()
which removes the host and all related services immediately.
@param[in] aInstance A pointer to the OpenThread instance.
@param[in] aService A pointer to a otSrpClientService
instance to add.
@retval OT_ERROR_NONE The addition of service started successfully. The otSrpClientCallback
will be
called to report the status.
@retval OT_ERROR_ALREADY A service with the same service and instance names is already in the list.
@retval OT_ERROR_INVALID_ARGS The service structure is invalid (e.g., bad service name or otDnsTxtEntry
).