Skip to content

Commit

Permalink
wid/hap: handle both HAS and IAS discovery in hdl_wid_20103
Browse files Browse the repository at this point in the history
  • Loading branch information
mringwal committed Sep 17, 2024
1 parent cdbd80c commit 1e6ac43
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions autopts/wid/hap.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,23 @@ def hdl_wid_20100(_: WIDParams):
return True


def hdl_wid_20103(_: WIDParams):
def hdl_wid_20103(params: WIDParams):
"""
Please take action to discover the Alert Level characteristic from the Immediate Alert.
Please take action to discover the X Control Point characteristic from the Y.
Discover the primary service if needed.
Description: Verify that the Implementation Under Test (IUT) can send Discover All Characteristics command.
"""
addr = pts_addr_get()
addr_type = pts_addr_type_get()
stack = get_stack()

btp.hap_iac_discover(addr_type, addr)
stack.hap.wait_iac_discovery_complete_ev(addr_type, addr, 30)
# Pick Service to discover by description text
if 'Alert Level' in params.description:
btp.hap_iac_discover(addr_type, addr)
stack.hap.wait_iac_discovery_complete_ev(addr_type, addr, 30)
else:
btp.hap_hauc_discover(addr_type, addr)
stack.hap.wait_hauc_discovery_complete_ev(addr_type, addr, 30)

return True

Expand Down

0 comments on commit 1e6ac43

Please sign in to comment.