File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -143,19 +143,19 @@ def write(self, data: bytearray) -> int:
143143 else :
144144 raise ValueError (f"Unsupported HCI packet type: { type } " )
145145
146- def read (self , bufsize = 1024 ):
146+ def read (self , bufsize = 1024 , timeout = 500 ):
147147 if not self .is_open :
148148 raise DeviceClosedException ()
149149 # Data endpoint
150150 try :
151- data_acl = self ._ep_acl_in .read (bufsize , timeout = 1 )
151+ data_acl = self ._ep_acl_in .read (bufsize , timeout = timeout )
152152 if data_acl and len (data_acl ) > 0 :
153153 return b"\x02 " + data_acl
154154 except usb .core .USBTimeoutError :
155155 pass
156156 # Event endpoint
157157 try :
158- data_evt = self ._ep_events .read (bufsize , timeout = 1 )
158+ data_evt = self ._ep_events .read (bufsize , timeout = timeout )
159159 if data_evt and len (data_evt ) > 0 :
160160 return b"\x04 " + data_evt
161161 except usb .core .USBTimeoutError :
You can’t perform that action at this time.
0 commit comments