ot::Srp::Client::EnableAutoHostAddress() method
Enables auto host address mode. When enabled host IPv6 addresses are automatically set by SRP client using all the unicast addresses on Thread netif excluding the link-local and mesh-local addresses. If there is no valid address, then Mesh Local EID address is added. The SRP client will automatically re-register when/if addresses on Thread netif are updated (new addresses are added or existing addresses are removed). The auto host address mode can be enabled before start or during operation of SRP client except when the host info is being removed (client is busy handling a remove request from an call to `RemoveHostAndServices()` and host info still being in either `kStateToRemove` or `kStateRemoving` states). After auto host address mode is enabled, it can be disabled by a call to `SetHostAddresses()` which then explicitly sets the host addresses.
Syntax
Error EnableAutoHostAddress(void); Return value
kErrorNone Successfully enabled auto host address mode. kErrorInvalidState Host is being removed and therefore cannot enable auto host address mode.
![]()
Error EnableAutoHostAddress(void);
ot::Srp::Client::EnableAutoHostAddress() calls 2 functions:
![]()
ot::Srp::Client::EnableAutoHostAddress()
ot::Srp::Client::EnableAutoHostAddress() reads 1 variable and writes 1 variable:
![]()
ot::Srp::Client::EnableAutoHostAddress()