mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 16:17:47 +00:00
[dua] handle coap error code for DUA.rsp (#5523)
- Configure next response to 5.00 for Reference Device - Handle 5.00 (and other COAP error codes) in DUA.rsp (required by 1.2 Test Spec) - Update DUA test to handle COAP code 5.00
This commit is contained in:
@@ -723,7 +723,13 @@ class NodeImpl:
|
||||
self.remove_prefix(prefix)
|
||||
self.register_netdata()
|
||||
|
||||
def set_next_dua_response(self, status, iid=None):
|
||||
def set_next_dua_response(self, status: Union[str, int], iid=None):
|
||||
# Convert 5.00 to COAP CODE 160
|
||||
if isinstance(status, str):
|
||||
assert '.' in status
|
||||
status = status.split('.')
|
||||
status = (int(status[0]) << 5) + int(status[1])
|
||||
|
||||
cmd = 'bbr mgmt dua {}'.format(status)
|
||||
if iid is not None:
|
||||
cmd += ' ' + str(iid)
|
||||
|
||||
Reference in New Issue
Block a user