Skip to content

Commit

Permalink
Remove device notification abort counter
Browse files Browse the repository at this point in the history
Devices notify however they want, and BTLE should faithfully reflect that.
  • Loading branch information
retsyx committed Jun 25, 2024
1 parent 5079c44 commit e0bf351
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions bluepy3/btle.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ def __init__(self) -> None:
self._stderr: TextIO = None # type: ignore[assignment]
self._mtu: int = 0
self.delegate = DefaultDelegate()
self._aita: int = 0

def _mgmtCmd(self, cmd) -> None:
self._writeCmd(cmd + "\n")
Expand All @@ -484,7 +483,6 @@ def _readToQueue(self) -> None:
def _startHelper(self, iface=None) -> None:
if self._helper is None:
DBG(f" -btle- Running {HELPER_PATH}")
self._aita = 0
self._lineq = Queue()
self._mtu = 0
# pylint: disable-next=consider-using-with
Expand Down Expand Up @@ -513,7 +511,6 @@ def _stopHelper(self) -> None:
self._helper.stdin.flush() # type:ignore[union-attr]
self._helper.wait()
self._helper = None # type: ignore[assignment]
self._aita = 0
if self._stderr is not None:
self._stderr.close()
self._stderr = None # type: ignore[assignment]
Expand All @@ -540,13 +537,6 @@ def _waitResp(
if "rsp" not in resp:
raise BTLEInternalError("No response type indicator", resp)

# sometimes devices just keep sending `ntfy`
if "ntfy" in repr(rv):
self._aita += 1
if self._aita > 3:
self._stopHelper()
raise BTLEInternalError("Device keeps repeating itself. Giving up.", resp)

try:
respType = resp["rsp"][0]
except KeyError as her:
Expand Down

0 comments on commit e0bf351

Please sign in to comment.