Skip to content

Commit

Permalink
Add support to boards with v5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fcachado committed Mar 7, 2022
1 parent b52d662 commit b389661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion bitalino.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def __init__(self, macAddress, timeout=None):
else:
version_nbr = float(version.split(split_string_old)[1][:3])
self.isBitalino2 = True if version_nbr >= 4.2 else False
self.isBitalino52 = True if version_nbr >= 5.2 else False

def start(self, SamplingRate=1000, analogChannels=[0, 1, 2, 3, 4, 5]):
"""
Expand Down Expand Up @@ -335,7 +336,10 @@ def state(self):
# <Battery threshold (1 byte: 0..63)>
# <Digital ports + CRC (1 byte: I1 I2 O1 O2 <CRC 4-bit>)>
self.send(11)
number_bytes = 16
if self.isBitalino52:
number_bytes = 17
else:
number_bytes = 16
Data = self.receive(number_bytes)
decodedData = list(struct.unpack(number_bytes * "B ", Data))
crc = decodedData[-1] & 0x0F
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def readme():

setup(
name="bitalino",
version="1.2.4",
version="1.2.5",
author="BITalinoWorld",
author_email="bitalino@plux.info",
url="http://www.bitalino.com/",
Expand All @@ -42,7 +42,7 @@ def readme():
keywords="BITalino, Physiological Computing, Biosignal, Physiological Signal",
python_requires=">=3.7",
install_requires=[
"numpy==1.21.5",
"numpy==1.22.2",
"pyserial==3.5",
"PyBluez-bitalino==0.30",
],
Expand Down

0 comments on commit b389661

Please sign in to comment.