Skip to content

Commit 2aa0a00

Browse files
committed
Fix ASQ status response parsing.
1 parent 5db5eea commit 2aa0a00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_si4713.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _asq_status(self):
261261
self._BUFFER[1] = 0x01
262262
self._write_from(self._BUFFER, count=2)
263263
# Now read 5 bytes of response data.
264-
self._read_into(self._BUFFER, count=8)
264+
self._read_into(self._BUFFER, count=5)
265265

266266
@property
267267
def tx_frequency_khz(self):
@@ -379,7 +379,7 @@ def input_level(self):
379379
"""
380380
# Perform ASQ request, then parse out 8 bit _signed_ input level value.
381381
self._asq_status()
382-
return ustruct.unpack('bbbb', self._BUFFER)[3]
382+
return ustruct.unpack('bbbbb', self._BUFFER)[4]
383383

384384
@property
385385
def audio_signal_status(self):
@@ -391,7 +391,7 @@ def audio_signal_status(self):
391391
"""
392392
# Perform ASQ request, the parse out the status byte.
393393
self._asq_status()
394-
return self._BUFFER[0]
394+
return self._BUFFER[1]
395395

396396
def gpio_control(self, gpio1=False, gpio2=False, gpio3=False):
397397
"""Control the GPIO outputs of the chip. Each gpio1, gpio2, gpio3

0 commit comments

Comments
 (0)