diff --git a/apps/nametags/nameservice.py b/apps/nametags/nameservice.py index eb35085..4a46aa4 100644 --- a/apps/nametags/nameservice.py +++ b/apps/nametags/nameservice.py @@ -19,7 +19,6 @@ class NameService(Service): uuid = StandardUUID(0xfeef) - _disp_rx = StreamIn(uuid=StandardUUID(0xfeee), timeout=1.0, buffer_size=8192) def __init__(self): super().__init__() @@ -30,8 +29,12 @@ def __init__(self): self._offset = 0 self._bufsize = 0 self._ledstate = False + self._disp_rx = None def update(self): + if self._disp_rx is None: + self._disp_rx = StreamIn(uuid=StandardUUID(0xfeee), timeout=1.0, buffer_size=8192) + while self._disp_rx.in_waiting > 0: if self._bufsize == 0: value = int.from_bytes(self._disp_rx.read(1), 'little')