Function openthread_sys::otSrpClientStart

source ·
pub unsafe extern "C" fn otSrpClientStart(
    aInstance: *mut otInstance,
    aServerSockAddr: *const otSockAddr,
) -> otError
Expand description

Starts the SRP client operation.

SRP client will prepare and send “SRP Update” message to the SRP server once all the following conditions are met:

  • The SRP client is started - otSrpClientStart() is called.
  • Host name is set - otSrpClientSetHostName() is called.
  • At least one host IPv6 address is set - otSrpClientSetHostName() is called.
  • At least one service is added - otSrpClientAddService() is called.

It does not matter in which order these functions are called. When all conditions are met, the SRP client will wait for a short delay before preparing an “SRP Update” message and sending it to server. This delay allows for user to add multiple services and/or IPv6 addresses before the first SRP Update message is sent (ensuring a single SRP Update is sent containing all the info). The config OPENTHREAD_CONFIG_SRP_CLIENT_UPDATE_TX_DELAY specifies the delay interval.

@param[in] aInstance A pointer to the OpenThread instance. @param[in] aServerSockAddr The socket address (IPv6 address and port number) of the SRP server.

@retval OT_ERROR_NONE SRP client operation started successfully or it is already running with same server socket address and callback. @retval OT_ERROR_BUSY SRP client is busy running with a different socket address. @retval OT_ERROR_FAILED Failed to open/connect the client’s UDP socket.