Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions adafruit_bluefruitspi.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _cmd(self, cmd): # pylint: disable=too-many-branches
spi.readinto(self._buf_rx)

# Read the message envelope and contents
msgtype, rspid, rsplen = struct.unpack('>BHB', self._buf_rx)
msgtype, rspid, rsplen = struct.unpack('>BHB', self._buf_rx[0:4])
if rsplen >= 16:
rsp += self._buf_rx[4:20]
else:
Expand Down Expand Up @@ -242,8 +242,7 @@ def command(self, string):
raise RuntimeError("Error (id:{0})".format(hex(msgid)))
if msgtype == _MSG_RESPONSE:
return rsp
else:
raise RuntimeError("Unknown response (id:{0})".format(hex(msgid)))
raise RuntimeError("Unknown response (id:{0})".format(hex(msgid)))
except RuntimeError as error:
raise RuntimeError("AT command failure: " + repr(error))

Expand Down