mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[srp-client] add aSendUnregToServer param to RemoveHostAndServices() (#6927)
This commit adds a new parameter `aSendUnregToServer` to SRP client's `RemoveHostAndServices()` API. This parameter determines the behavior when the host info is not yet registered with the server. If it is set to `false` (which is the default/expected value) then the SRP client will immediately remove the host info and services without sending an update message to server (no need to update the server if nothing is yet registered with it). If it is set to `true` then the SRP client will send an update message to the server. Note that if the host info is registered then the value of `aSendUnregToServer` does not matter and the SRP client will always send an update message to the server requesting removal of all info. One situation where this parameter can be useful is on a device reset/reboot where the caller may want to remove any previously registered services with the server. In this case, caller can `SetHostName()` and then request `RemoveHostAndServices()` with `aSendUnregToServer` as `true`. This commit also adds `test_srp_client_remove_host.py` which verifies the behavior the newly added mechanism between client and server.
This commit is contained in:
committed by
Jonathan Hui
parent
da629d63ff
commit
5851524d7a
@@ -989,8 +989,8 @@ class NodeImpl:
|
||||
self.send_command(f'srp client host name')
|
||||
self._expect_done()
|
||||
|
||||
def srp_client_remove_host(self, remove_key=False):
|
||||
self.send_command(f'srp client host remove {"1" if remove_key else "0"}')
|
||||
def srp_client_remove_host(self, remove_key=False, send_unreg_to_server=False):
|
||||
self.send_command(f'srp client host remove {int(remove_key)} {int(send_unreg_to_server)}')
|
||||
self._expect_done()
|
||||
|
||||
def srp_client_clear_host(self):
|
||||
|
||||
Reference in New Issue
Block a user