File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
adafruit_bluefruit_connect Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,17 @@ def from_stream(cls, stream):
101
101
# Timeout: nothing more read.
102
102
return None
103
103
break
104
- # Didn't find a packet start. Loop and try again.
104
+ # Didn't find a packet start.
105
+ else :
106
+ text_packet_cls = cls ._type_to_class .get (b"TX" , None )
107
+ # Is TextPacket registered?
108
+ # If so, read an entire line and pass that to TextPacket.
109
+ if text_packet_cls :
110
+ ln = stream .readline ()
111
+ packet = bytes (start + ln )
112
+ return text_packet_cls (packet )
113
+
114
+ # else loop and try again.
105
115
106
116
header = bytes (start + packet_type )
107
117
packet_class = cls ._type_to_class .get (header , None )
Original file line number Diff line number Diff line change 21
21
22
22
"""
23
23
24
- import struct
25
-
26
24
from .packet import Packet
27
25
28
26
You can’t perform that action at this time.
0 commit comments