@@ -338,6 +338,15 @@ async def wait_for_shell_response(dut, message):
338
338
return found , lines
339
339
340
340
341
+ async def device_power_on (device ) -> None :
342
+ while True :
343
+ try :
344
+ await device .power_on ()
345
+ break
346
+ except Exception :
347
+ continue
348
+
349
+
341
350
async def sdp_ssa_discover_no_record (hci_port , shell , dut , address ) -> None :
342
351
logger .info ('<<< SDP Discovery ...' )
343
352
async with await open_transport_or_link (hci_port ) as hci_transport :
@@ -353,7 +362,7 @@ async def sdp_ssa_discover_no_record(hci_port, shell, dut, address) -> None:
353
362
# device.sdp_service_records = SDP_SERVICE_RECORDS
354
363
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
355
364
device .host .snooper = BtSnooper (snoop_file )
356
- await device . power_on ( )
365
+ await device_power_on ( device )
357
366
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
358
367
359
368
target_address = address .split (" " )[0 ]
@@ -386,7 +395,7 @@ async def sdp_ssa_discover_one_record(hci_port, shell, dut, address) -> None:
386
395
device .sdp_service_records = SDP_SERVICE_ONE_RECORD
387
396
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
388
397
device .host .snooper = BtSnooper (snoop_file )
389
- await device . power_on ( )
398
+ await device_power_on ( device )
390
399
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
391
400
392
401
target_address = address .split (" " )[0 ]
@@ -443,7 +452,7 @@ async def sdp_ssa_discover_two_records(hci_port, shell, dut, address) -> None:
443
452
device .sdp_service_records = SDP_SERVICE_TWO_RECORDS
444
453
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
445
454
device .host .snooper = BtSnooper (snoop_file )
446
- await device . power_on ( )
455
+ await device_power_on ( device )
447
456
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
448
457
449
458
target_address = address .split (" " )[0 ]
@@ -513,7 +522,7 @@ async def sdp_ssa_discover_multiple_records(hci_port, shell, dut, address) -> No
513
522
device .sdp_service_records = SDP_SERVICE_MULTIPLE_RECORDS
514
523
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
515
524
device .host .snooper = BtSnooper (snoop_file )
516
- await device . power_on ( )
525
+ await device_power_on ( device )
517
526
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
518
527
519
528
target_address = address .split (" " )[0 ]
@@ -547,7 +556,7 @@ async def sdp_ss_discover_no_record(hci_port, shell, dut, address) -> None:
547
556
# device.sdp_service_records = SDP_SERVICE_RECORDS
548
557
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
549
558
device .host .snooper = BtSnooper (snoop_file )
550
- await device . power_on ( )
559
+ await device_power_on ( device )
551
560
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
552
561
553
562
target_address = address .split (" " )[0 ]
@@ -580,7 +589,7 @@ async def sdp_ss_discover_one_record(hci_port, shell, dut, address) -> None:
580
589
device .sdp_service_records = SDP_SERVICE_ONE_RECORD
581
590
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
582
591
device .host .snooper = BtSnooper (snoop_file )
583
- await device . power_on ( )
592
+ await device_power_on ( device )
584
593
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
585
594
586
595
target_address = address .split (" " )[0 ]
@@ -623,7 +632,7 @@ async def sdp_ss_discover_two_records(hci_port, shell, dut, address) -> None:
623
632
device .sdp_service_records = SDP_SERVICE_TWO_RECORDS
624
633
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
625
634
device .host .snooper = BtSnooper (snoop_file )
626
- await device . power_on ( )
635
+ await device_power_on ( device )
627
636
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
628
637
629
638
target_address = address .split (" " )[0 ]
@@ -666,7 +675,7 @@ async def sdp_ss_discover_multiple_records(hci_port, shell, dut, address) -> Non
666
675
device .sdp_service_records = SDP_SERVICE_MULTIPLE_RECORDS
667
676
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
668
677
device .host .snooper = BtSnooper (snoop_file )
669
- await device . power_on ( )
678
+ await device_power_on ( device )
670
679
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
671
680
672
681
target_address = address .split (" " )[0 ]
@@ -710,7 +719,7 @@ async def sdp_sa_discover_no_record(hci_port, shell, dut, address) -> None:
710
719
# device.sdp_service_records = SDP_SERVICE_RECORDS
711
720
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
712
721
device .host .snooper = BtSnooper (snoop_file )
713
- await device . power_on ( )
722
+ await device_power_on ( device )
714
723
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
715
724
716
725
target_address = address .split (" " )[0 ]
@@ -743,7 +752,7 @@ async def sdp_sa_discover_one_record(hci_port, shell, dut, address) -> None:
743
752
device .sdp_service_records = SDP_SERVICE_ONE_RECORD
744
753
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
745
754
device .host .snooper = BtSnooper (snoop_file )
746
- await device . power_on ( )
755
+ await device_power_on ( device )
747
756
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
748
757
749
758
target_address = address .split (" " )[0 ]
@@ -797,7 +806,7 @@ async def sdp_sa_discover_two_records(hci_port, shell, dut, address) -> None:
797
806
device .sdp_service_records = SDP_SERVICE_TWO_RECORDS
798
807
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
799
808
device .host .snooper = BtSnooper (snoop_file )
800
- await device . power_on ( )
809
+ await device_power_on ( device )
801
810
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
802
811
803
812
target_address = address .split (" " )[0 ]
@@ -860,7 +869,7 @@ async def sdp_sa_discover_multiple_records(hci_port, shell, dut, address) -> Non
860
869
device .sdp_service_records = SDP_SERVICE_MULTIPLE_RECORDS
861
870
with open (f"bumble_hci_{ sys ._getframe ().f_code .co_name } .log" , "wb" ) as snoop_file :
862
871
device .host .snooper = BtSnooper (snoop_file )
863
- await device . power_on ( )
872
+ await device_power_on ( device )
864
873
await device .send_command (HCI_Write_Page_Timeout_Command (page_timeout = 0xFFFF ))
865
874
866
875
target_address = address .split (" " )[0 ]
0 commit comments